diff options
author | Uoti Urpala <uoti.urpala@pp1.inet.fi> | 2011-12-18 16:17:07 +0200 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-12-18 06:58:03 -0800 |
commit | 488a5b3fddce6714cfa7ccd4a5c91cd2dd355033 (patch) | |
tree | dcae79d1a0dc96225d7d997c8873d641f7549d35 /libavcodec/tmv.c | |
parent | 0ea5b44275aa334528eb384a6548cc9f98c50a17 (diff) | |
download | ffmpeg-488a5b3fddce6714cfa7ccd4a5c91cd2dd355033.tar.gz |
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.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/tmv.c')
-rw-r--r-- | libavcodec/tmv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index 870f57159c..be809b3675 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 tmv_decode_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 = tmv_decode_init, .close = tmv_decode_close, .decode = tmv_decode_frame, .capabilities = CODEC_CAP_DR1, |