aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-04-25 04:08:21 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-04-27 04:40:12 +0200
commit05b33258e3ac3fca4586c67da596330fbc9dfaf5 (patch)
treeba146957a88152e265dbe4697cae7cf661324443 /libavcodec
parentc6e3682a0c19101e553552c19822add392242195 (diff)
downloadffmpeg-05b33258e3ac3fca4586c67da596330fbc9dfaf5.tar.gz
avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
Fixes Ticket5319 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 9ac154d1facd4756db6918f866dccf3e3ffb698c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3dec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 398224753f..4ad99ce47c 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -901,11 +901,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
ff_eac3_default_spx_band_struct,
&s->num_spx_bands,
s->spx_band_sizes);
- } else {
- for (ch = 1; ch <= fbw_channels; ch++) {
- s->channel_uses_spx[ch] = 0;
- s->first_spx_coords[ch] = 1;
- }
+ }
+ }
+ if (!s->eac3 || !s->spx_in_use) {
+ s->spx_in_use = 0;
+ for (ch = 1; ch <= fbw_channels; ch++) {
+ s->channel_uses_spx[ch] = 0;
+ s->first_spx_coords[ch] = 1;
}
}