From 01042d4123b6e0a4c15d6828f835bd648eb03d38 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 2 May 2011 02:15:15 +0200 Subject: lavc: set defaults in internal codec frames This is required specifically for setting frame->format to -1, otherwise it will be set to 0 = PIX_FMT_YUV420P and code reading the format from the output decoded frame will get misled. In particular fix regressions occurring with the pending vsrc_buffer patch. --- libavcodec/pictordec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libavcodec/pictordec.c') diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 8981dbc759..b87c8643d0 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -94,6 +94,14 @@ static const uint8_t cga_mode45_index[6][4] = { [5] = { 0, 11, 12, 15 }, // mode5, high intensity }; +static av_cold int decode_init(AVCodecContext *avctx) +{ + PicContext *s = avctx->priv_data; + + avcodec_get_frame_defaults(&s->frame); + return 0; +} + static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) @@ -242,7 +250,7 @@ AVCodec ff_pictor_decoder = { AVMEDIA_TYPE_VIDEO, CODEC_ID_PICTOR, sizeof(PicContext), - NULL, + decode_init, NULL, decode_end, decode_frame, -- cgit v1.2.3