summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Huber <andih@google.com> 2011-08-12 11:38:24 -0700
committer Andreas Huber <andih@google.com> 2011-08-12 11:38:24 -0700
commitf77493e6560765882e09f4199e7f295564bede05 (patch)
tree1e35917b6e5978e508bd9925ec9a28554b3bda1d
parentd5962a128ac6e0a71137fc18670745991647c645 (diff)
Fix the software AAC decoder's AAC+ detection to ignore malformed frames
at the beginning of the stream. Change-Id: Ib990848c696896e7d43c80dec8119dec35704b74 related-to-bug: 5122512
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.cpp b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
index bbd6dbb239fa..f0a330f3e156 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
@@ -316,7 +316,7 @@ void SoftAAC::onQueueFilled(OMX_U32 portIndex) {
* Thus, we could not say for sure whether a stream is
* AAC+/eAAC+ until the first data frame is decoded.
*/
- if (mInputBufferCount <= 2) {
+ if (decoderErr == MP4AUDEC_SUCCESS && mInputBufferCount <= 2) {
LOGV("audio/extended audio object type: %d + %d",
mConfig->audioObjectType, mConfig->extendedAudioObjectType);
LOGV("aac+ upsampling factor: %d desired channels: %d",
@@ -410,7 +410,9 @@ void SoftAAC::onQueueFilled(OMX_U32 portIndex) {
notifyFillBufferDone(outHeader);
outHeader = NULL;
- ++mInputBufferCount;
+ if (decoderErr == MP4AUDEC_SUCCESS) {
+ ++mInputBufferCount;
+ }
}
}