>From ab12550fb90253175a33770802885203fafd8435 Mon Sep 17 00:00:00 2001
From: Uoti Urpala <[email protected]>
Date: Sun, 18 Dec 2011 16:17:07 +0200
Subject: [PATCH] tmv decoder: set correct pix_fmt

Previously the decoder only worked if the user had set avctx->pix_fmt
manually. For some reason the libavformat tmv demuxer sets this, so
the problem was not visible in avplay etc.
---
 libavcodec/tmv.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c
index 870f571..ef2fe9f 100644
--- a/libavcodec/tmv.c
+++ b/libavcodec/tmv.c
@@ -82,6 +82,12 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data,
     return avpkt->size;
 }
 
+static av_cold int init(AVCodecContext *avctx)
+{
+    avctx->pix_fmt = PIX_FMT_PAL8;
+    return 0;
+}
+
 static av_cold int tmv_decode_close(AVCodecContext *avctx)
 {
     TMVContext *tmv = avctx->priv_data;
@@ -97,6 +103,7 @@ AVCodec ff_tmv_decoder = {
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = CODEC_ID_TMV,
     .priv_data_size = sizeof(TMVContext),
+    .init           = init,
     .close          = tmv_decode_close,
     .decode         = tmv_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-- 
1.7.6.561.g3822

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to