From 8c642f070b1c7e9f8f2d57adc879829f80bd90c8 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 25 Feb 2025 16:40:56 +0100 Subject: [PATCH 27/30] avcodec/mpeg12dec: Really disable scratchpad allocations ba341be09533a077075c71fce5f9dc5b73504234 disabled them for the main thread only, not the slice threads. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12dec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index abef0a6155..843640edbf 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1001,7 +1001,8 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((ret = ff_mpv_common_init(s)) < 0) return ret; if (!s->avctx->lowres) - ff_mpv_framesize_disable(&s->sc); + for (int i = 0; i < s->slice_context_count; i++) + ff_mpv_framesize_disable(&s->thread_context[i]->sc); } return 0; } @@ -1874,7 +1875,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx) if ((ret = ff_mpv_common_init(s)) < 0) return ret; if (!s->avctx->lowres) - ff_mpv_framesize_disable(&s->sc); + for (int i = 0; i < s->slice_context_count; i++) + ff_mpv_framesize_disable(&s->thread_context[i]->sc); for (i = 0; i < 64; i++) { int j = s->idsp.idct_permutation[i]; -- 2.45.2