Kaynağa Gözat

Merge pull request #2319 from jpark37/rgb-dib

win-dshow: Fix upside-down RGB DIBs
Jim 6 yıl önce
ebeveyn
işleme
37a7805ad5
1 değiştirilmiş dosya ile 7 ekleme ve 2 silme
  1. 7 2
      plugins/win-dshow/win-dshow.cpp

+ 7 - 2
plugins/win-dshow/win-dshow.cpp

@@ -539,8 +539,13 @@ void DShowInput::OnVideoData(const VideoConfig &config, unsigned char *data,
 	frame.format = ConvertVideoFormat(config.format);
 	frame.flip = flip;
 
-	if (config.cy_flip)
-		frame.flip = !frame.flip;
+	/* YUV DIBS are always top-down */
+	if (config.format == VideoFormat::XRGB ||
+	    config.format == VideoFormat::ARGB) {
+		/* RGB DIBs are bottom-up by default */
+		if (!config.cy_flip)
+			frame.flip = !frame.flip;
+	}
 
 	if (videoConfig.format == VideoFormat::XRGB ||
 	    videoConfig.format == VideoFormat::ARGB) {