From e31dc4f234326f711a486a7f73611ff9d1bafd21 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 25 Mar 2025 06:09:50 +0100 Subject: [PATCH 11/44] avcodec/h261dec: Use ff_mpv_decode_reinit() Signed-off-by: Andreas Rheinhardt --- libavcodec/h261dec.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 146f979a5e..853a94a25a 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -28,7 +28,6 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" -#include "decode.h" #include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" @@ -562,15 +561,9 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, return -1; } - if (s->width != avctx->coded_width || s->height != avctx->coded_height) { - ff_mpv_common_end(s); - } - - if (!s->context_initialized) { - if ((ret = ff_mpv_common_init(s)) < 0) - return ret; - - ret = ff_set_dimensions(avctx, s->width, s->height); + if (s->width != avctx->coded_width || s->height != avctx->coded_height || + !s->context_initialized) { + ret = ff_mpv_decode_reinit(s); if (ret < 0) return ret; } -- 2.45.2