From f77493e6560765882e09f4199e7f295564bede05 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 12 Aug 2011 11:38:24 -0700 Subject: 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 --- media/libstagefright/codecs/aacdec/SoftAAC.cpp | 6 ++++-- 1 file 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; + } } } -- cgit v1.2.3-59-g8ed1b