[FFmpeg-cvslog] MSS1 and MSS2: set final pixel format after common stuff has been initialised

Alberto Delmás git at videolan.org
Fri Aug 31 13:39:12 CEST 2012


ffmpeg | branch: master | Alberto Delmás <adelmas at gmail.com> | Fri Aug 31 07:59:36 2012 +0200| [ede3d6400d7c06863e6eb4bcff5f676480ae6b5e] | committer: Kostya Shishkov

MSS1 and MSS2: set final pixel format after common stuff has been initialised

This way it won't interfere with WMV9 initialisation inside MSS2 decoder and
avplay will play it fine.

Signed-off-by: Kostya Shishkov <kostya.shishkov at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ede3d6400d7c06863e6eb4bcff5f676480ae6b5e
---

 libavcodec/mss1.c  |    7 ++++++-
 libavcodec/mss12.c |    4 ----
 libavcodec/mss2.c  |    4 ++++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
index ada479e..caf0328 100644
--- a/libavcodec/mss1.c
+++ b/libavcodec/mss1.c
@@ -189,11 +189,16 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
 static av_cold int mss1_decode_init(AVCodecContext *avctx)
 {
     MSS1Context * const c = avctx->priv_data;
+    int ret;
 
     c->ctx.avctx       = avctx;
     avctx->coded_frame = &c->pic;
 
-    return ff_mss12_decode_init(&c->ctx, 0);
+    ret = ff_mss12_decode_init(&c->ctx, 0);
+
+    avctx->pix_fmt = PIX_FMT_PAL8;
+
+    return ret;
 }
 
 static av_cold int mss1_decode_end(AVCodecContext *avctx)
diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c
index f0f23c0..18f2f28 100644
--- a/libavcodec/mss12.c
+++ b/libavcodec/mss12.c
@@ -690,10 +690,6 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version)
         return AVERROR(ENOMEM);
     }
 
-    avctx->pix_fmt = version ? c->free_colours == 127 ? PIX_FMT_RGB555
-                                                      : PIX_FMT_RGB24
-                             : PIX_FMT_PAL8;
-
     codec_init(c, version);
 
     return 0;
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index c0c47dc..2a0bf47 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -844,6 +844,10 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx)
         return ret;
     }
     ff_mss2dsp_init(&ctx->dsp);
+
+    avctx->pix_fmt = c->free_colours == 127 ? PIX_FMT_RGB555
+                                            : PIX_FMT_RGB24;
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list