]> git.sesse.net Git - nageru/commitdiff
Fix an inverted condition in YCbCr format choice.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Jul 2023 21:05:42 +0000 (23:05 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Jul 2023 21:05:42 +0000 (23:05 +0200)
nageru/ffmpeg_capture.cpp

index dd053f89292a409c84f7064c422478d7bfd32990..384ecdb67cc9400cbb82d000b1d352633e8d6a8e 100644 (file)
@@ -123,8 +123,8 @@ AVPixelFormat decide_dst_format(AVPixelFormat src_format, bmusb::PixelFormat dst
                if (desc->comp[0].depth != 8) continue;
 
                // Same or better chroma resolution only.
-               int chroma_w_diff = desc->log2_chroma_w - src_desc->log2_chroma_w;
-               int chroma_h_diff = desc->log2_chroma_h - src_desc->log2_chroma_h;
+               int chroma_w_diff = src_desc->log2_chroma_w - desc->log2_chroma_w;
+               int chroma_h_diff = src_desc->log2_chroma_h - desc->log2_chroma_h;
                if (chroma_w_diff < 0 || chroma_h_diff < 0)
                        continue;