From 6e75823015ea7c724185642e5f2380a5d52ae456 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 30 Apr 2025 01:00:59 +0200 Subject: [PATCH 28/44] avcodec/mpeg4videodec: Avoid redundant ff_mpv_common_init() ff_mpeg_update_thread_context() will initialize it for us. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg4videodec.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 39c05859d3..4e1c4e31d8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3807,7 +3807,7 @@ static av_cold void clear_context(MpegEncContext *s) s->context_reinit = 0; } -static av_cold int update_mpvctx(MpegEncContext *s, const MpegEncContext *s1) +static av_cold void update_mpvctx(MpegEncContext *s, const MpegEncContext *s1) { AVCodecContext *avctx = s->avctx; // FIXME the following leads to a data race; instead copy only @@ -3816,13 +3816,6 @@ static av_cold int update_mpvctx(MpegEncContext *s, const MpegEncContext *s1) clear_context(s); s->avctx = avctx; - - if (s1->context_initialized) { - int err = ff_mpv_common_init(s); - if (err < 0) - return err; - } - return 0; } static int mpeg4_update_thread_context(AVCodecContext *dst, @@ -3833,11 +3826,8 @@ static int mpeg4_update_thread_context(AVCodecContext *dst, int init = s->m.context_initialized; int ret; - if (!init) { - ret = update_mpvctx(&s->m, &s1->m); - if (ret < 0) - return ret; - } + if (!init) + update_mpvctx(&s->m, &s1->m); ret = ff_mpeg_update_thread_context(dst, src); if (ret < 0) -- 2.45.2