OSDN Git Service

Fix aac decoder flush
authorMarco Nelissen <marcone@google.com>
Fri, 20 Sep 2013 14:18:21 +0000 (07:18 -0700)
committerGlenn Kasten <gkasten@android.com>
Wed, 2 Apr 2014 18:41:14 +0000 (11:41 -0700)
b/8543366

Change-Id: I746ffed6289486b802a2292bfc492ea6c780ed0b

media/libstagefright/codecs/aacdec/SoftAAC2.cpp

index c9b5d26..f842e27 100644 (file)
@@ -567,6 +567,12 @@ void SoftAAC2::onPortFlushCompleted(OMX_U32 portIndex) {
         // depend on fragments from the last one decoded.
         // drain all existing data
         drainDecoder();
+        // force decoder loop to drop the first decoded buffer by resetting these state variables,
+        // but only if initialization has already happened.
+        if (mInputBufferCount != 0) {
+            mInputBufferCount = 1;
+            mStreamInfo->sampleRate = 0;
+        }
     }
 }