summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2013-09-20 07:18:21 -0700
committerGlenn Kasten <gkasten@android.com>2014-04-02 11:41:14 -0700
commit08fce45fdb537e135868604522aba15461f516be (patch)
tree0645a0440cbb2f4bda446d3e073916c82d30e033 /media/libstagefright/codecs/aacdec/SoftAAC2.cpp
parentc71a99131ca97bd3bdc5b78473d06e613e96e073 (diff)
downloadframeworks_av-08fce45fdb537e135868604522aba15461f516be.zip
frameworks_av-08fce45fdb537e135868604522aba15461f516be.tar.gz
frameworks_av-08fce45fdb537e135868604522aba15461f516be.tar.bz2
Fix aac decoder flush
b/8543366 Change-Id: I746ffed6289486b802a2292bfc492ea6c780ed0b
Diffstat (limited to 'media/libstagefright/codecs/aacdec/SoftAAC2.cpp')
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC2.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
index c9b5d26..f842e27 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
@@ -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;
+ }
}
}