[FFmpeg-cvslog] avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3

Michael Niedermayer git at videolan.org
Tue Apr 26 02:48:38 CEST 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Mon Apr 25 04:08:21 2016 +0200| [4c896d6bd47870aee4684515747f4f7f927bebc0] | committer: Michael Niedermayer

avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3

Fixes Ticket5319

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9ac154d1facd4756db6918f866dccf3e3ffb698c)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/ac3dec.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 5d5330c..f82f397 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -895,11 +895,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;
         }
     }
 



More information about the ffmpeg-cvslog mailing list