changeset 11007:8d4ae55fdada libavcodec

Metasoft MJPEG codec has Cb and Cr swapped, fixes issue 1611.
author cehoyos
date Tue, 26 Jan 2010 10:30:24 +0000
parents d99420b73262
children ec192d9ebac5
files mjpegdec.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mjpegdec.c	Mon Jan 25 13:26:10 2010 +0000
+++ b/mjpegdec.c	Tue Jan 26 10:30:24 2010 +0000
@@ -920,6 +920,10 @@
             av_log(s->avctx, AV_LOG_ERROR, "decode_sos: index(%d) out of components\n", index);
             return -1;
         }
+        /* Metasoft MJPEG codec has Cb and Cr swapped */
+        if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J')
+            && nb_components == 3 && s->nb_components == 3 && i)
+            index = 3 - i;
 
         s->comp_index[i] = index;