avcodec/ac3dec: fix downmix logic for eac3

Ensure downmixed is only set once during init, as it used to be.

Fixes a regression since acbb2777e2.
Fixes ticket #11321

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 0e07a70611)
release/7.1
James Almer 1 month ago
parent f265f9c9d0
commit 364f6a5f11
  1. 2
      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];

Loading…
Cancel
Save