From e4470a8e30de8af6150b4a78ea0637ca7d62b824 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 24 Feb 2025 22:16:36 +0100 Subject: [PATCH] avcodec/h263dec: Don't call ff_thread_finish_setup() unnecessarily All hwaccels for MPEG-4/H.263 are run serially even when frame-threading is in use. Therefore there is no gain in calling ff_thread_finish_setup() in this case right before outputting the frame. Removing this call also allows to revert commit 39a5c0ac0651113750d01f3ee6bcf3819de3d7ee. Signed-off-by: Andreas Rheinhardt --- libavcodec/h263dec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index fa1146f025..2d8c200589 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -575,7 +575,7 @@ retry: if ((ret = ff_mpv_frame_start(s, avctx)) < 0) return ret; - if (!s->divx_packed && !avctx->hwaccel) + if (!s->divx_packed) ff_thread_finish_setup(avctx); if (avctx->hwaccel) { @@ -647,9 +647,6 @@ frame_end: if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) ff_mpeg4_frame_end(avctx, buf, buf_size); - if (!s->divx_packed && avctx->hwaccel) - ff_thread_finish_setup(avctx); - av_assert1(s->pict_type == s->cur_pic.ptr->f->pict_type); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0)