diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-04-25 04:08:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-04-29 14:23:41 +0200 |
commit | 542cc06c649b6ea77b5313591ed8fe89ff987b0c (patch) | |
tree | 8b58b798cd69a3b0d095c53ae4e6e5f6019f3fa8 | |
parent | 987082ff913841815a4ff7428c9379cecc63a3c9 (diff) | |
download | ffmpeg-542cc06c649b6ea77b5313591ed8fe89ff987b0c.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>
-rw-r--r-- | libavcodec/ac3dec.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index ae4129ff9d..c01859093d 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -902,11 +902,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; } } |