[FFmpeg-cvslog] avcodec/ac3dec: fix downmix logic for eac3

James Almer git at videolan.org
Sun Dec 1 18:48:04 EET 2024


ffmpeg | branch: release/7.1 | James Almer <jamrial at gmail.com> | Sun Nov 24 14:24:47 2024 -0300| [364f6a5f118d35058a49eee3624c5d82435be443] | committer: James Almer

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 <jamrial at gmail.com>
(cherry picked from commit 0e07a70611dc109f4e84895ffc79827a91edc045)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=364f6a5f118d35058a49eee3624c5d82435be443
---

 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];



More information about the ffmpeg-cvslog mailing list