jpegdec: try to fix different flipping behavior of inteljpegs.
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 3 Sep 2012 21:39:50 +0000 (23:39 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 3 Sep 2012 21:39:50 +0000 (23:39 +0200)
This may need some trial and error to find exactly how to identify them
so please report any intel jpegs that get fliped wrong.

Fixes Ticket511

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c

index c6297c3..9f81302 100644 (file)
@@ -1468,7 +1468,7 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
                 // printf("mjpeg: workarounding buggy AVID\n");
             } else if (!strcmp(cbuf, "CS=ITU601"))
                 s->cs_itu601 = 1;
-            else if ((len > 20 && !strncmp(cbuf, "Intel(R) JPEG Library", 21)) ||
+            else if ((len > 31 && !strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32)) ||
                      (len > 19 && !strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
                 s->flipped = 1;