From 122baae2f2aedca38fab723f7ad672044b0ce413 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Mon, 20 Jun 2011 16:19:09 -0700 Subject: Restore legacy soft-aac decoder behaviour. Substitute silence on decode error. Change-Id: I680ccaabef32b1319819f723260cb3789585f09e related-to-bug: 4579486 --- media/libstagefright/codecs/aacdec/SoftAAC.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.cpp b/media/libstagefright/codecs/aacdec/SoftAAC.cpp index 7ce6128..bbd6dbb 100644 --- a/media/libstagefright/codecs/aacdec/SoftAAC.cpp +++ b/media/libstagefright/codecs/aacdec/SoftAAC.cpp @@ -367,7 +367,15 @@ void SoftAAC::onQueueFilled(OMX_U32 portIndex) { inHeader->nFilledLen -= mConfig->inputBufferUsedLength; inHeader->nOffset += mConfig->inputBufferUsedLength; } else { + LOGW("AAC decoder returned error %d, substituting silence", + decoderErr); + memset(outHeader->pBuffer + outHeader->nOffset, 0, numOutBytes); + + // Discard input buffer. + inHeader->nFilledLen = 0; + + // fall through } if (mUpsamplingFactor == 2) { -- cgit v1.1