changeset 10720:bcc62edd9b41 libavcodec

16-bit Interplay video does not need palette control
author kostya
date Sun, 27 Dec 2009 14:07:21 +0000
parents cc2f80bbf304
children 07c893df0334
files interplayvideo.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/interplayvideo.c	Sun Dec 27 09:12:50 2009 +0000
+++ b/interplayvideo.c	Sun Dec 27 14:07:21 2009 +0000
@@ -1017,13 +1017,13 @@
 
     s->avctx = avctx;
 
-    if (s->avctx->palctrl == NULL) {
+    s->is_16bpp = avctx->bits_per_coded_sample == 16;
+    avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8;
+    if (!s->is_16bpp && s->avctx->palctrl == NULL) {
         av_log(avctx, AV_LOG_ERROR, " Interplay video: palette expected.\n");
         return -1;
     }
 
-    s->is_16bpp = avctx->bits_per_coded_sample == 16;
-    avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8;
     dsputil_init(&s->dsp, avctx);
 
     /* decoding map contains 4 bits of information per 8x8 block */