From 0e07a70611dc109f4e84895ffc79827a91edc045 Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 24 Nov 2024 14:24:47 -0300 Subject: [PATCH] avcodec/ac3dec: fix downmix logic for eac3 Ensure downmixed is only set once during init, as it used to be. Fixes a regression since acbb2777e28c. Fixes ticket #11321 Signed-off-by: James Almer --- libavcodec/ac3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 0a4d3375ee..3cc20f32a9 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -199,7 +199,6 @@ static void ac3_downmix(AVCodecContext *avctx) av_channel_layout_uninit(&avctx->ch_layout); avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; } - s->downmixed = 1; } /** @@ -241,6 +240,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; ac3_downmix(avctx); + s->downmixed = 1; for (i = 0; i < AC3_MAX_CHANNELS; i++) { s->xcfptr[i] = s->transform_coeffs[i];