changeset 1740:0c686b4cd576 libavcodec

grayscale mjpeg decoding support based upon a patch by (Leon Bottou (leonb))
author michael
date Sat, 10 Jan 2004 19:54:12 +0000
parents 07a484280a82
children f0c21b9a328e
files mjpeg.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mjpeg.c	Sat Jan 10 16:04:55 2004 +0000
+++ b/mjpeg.c	Sat Jan 10 19:54:12 2004 +0000
@@ -1052,8 +1052,10 @@
     case 0x11:
         if(s->rgb){
             s->avctx->pix_fmt = PIX_FMT_RGBA32;
-        }else
+        }else if(s->nb_components==3)
             s->avctx->pix_fmt = PIX_FMT_YUV444P;
+        else
+            s->avctx->pix_fmt = PIX_FMT_GRAY8;
         break;
     case 0x21:
         s->avctx->pix_fmt = PIX_FMT_YUV422P;
@@ -1372,7 +1374,7 @@
 	return -1;
     }
     /* XXX: only interleaved scan accepted */
-    if (nb_components != 3)
+    if (nb_components != s->nb_components)
     {
 	dprintf("decode_sos: components(%d) mismatch\n", nb_components);
         return -1;