X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Ftmv.c;h=b1083fe682192976c1ac20eb7459efef6b5b06f4;hb=6d6b0c96fdc576f4643e3d4066e5ebebdb693ade;hp=62b6e19de107c1cbaa738c743fbf9426017c63d4;hpb=3788a3c0c03585b0f8180a16d2a15b8e0e033313;p=ffmpeg diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index 62b6e19de10..b1083fe6821 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -34,6 +34,14 @@ typedef struct TMVContext { AVFrame pic; } TMVContext; +static av_cold int tmv_decode_init(AVCodecContext *avctx) +{ + TMVContext *tmv = avctx->priv_data; + + avcodec_get_frame_defaults(&tmv->pic); + return 0; +} + static int tmv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { @@ -59,7 +67,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, return -1; } - tmv->pic.pict_type = FF_I_TYPE; + tmv->pic.pict_type = AV_PICTURE_TYPE_I; tmv->pic.key_frame = 1; dst = tmv->pic.data[0]; @@ -97,6 +105,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,