Loading media/libstagefright/codecs/aacdec/SoftAAC2.cpp +14 −5 Original line number Diff line number Diff line Loading @@ -654,6 +654,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { inHeader->nOffset += inBufferUsedLength; AAC_DECODER_ERROR decoderErr; int numLoops = 0; do { if (outputDelayRingBufferSpaceLeft() < (mStreamInfo->frameSize * mStreamInfo->numChannels)) { Loading @@ -661,20 +662,19 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { break; } int numconsumed = mStreamInfo->numTotalBytes + mStreamInfo->numBadBytes; int numConsumed = mStreamInfo->numTotalBytes; decoderErr = aacDecoder_DecodeFrame(mAACDecoder, tmpOutBuffer, 2048 * MAX_CHANNEL_COUNT, 0 /* flags */); numconsumed = (mStreamInfo->numTotalBytes + mStreamInfo->numBadBytes) - numconsumed; if (numconsumed != 0) { mDecodedSizes.add(numconsumed); } numConsumed = mStreamInfo->numTotalBytes - numConsumed; numLoops++; if (decoderErr == AAC_DEC_NOT_ENOUGH_BITS) { break; } mDecodedSizes.add(numConsumed); if (decoderErr != AAC_DEC_OK) { ALOGW("aacDecoder_DecodeFrame decoderErr = 0x%4.4x", decoderErr); Loading Loading @@ -716,6 +716,15 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { aacDecoder_SetParam(mAACDecoder, AAC_TPDEC_CLEAR_BUFFER, 1); // After an error, replace the last entry in mBufferSizes with the sum of the // last <numLoops> entries from mDecodedSizes to resynchronize the in/out lists. mBufferSizes.pop(); int n = 0; for (int i = 0; i < numLoops; i++) { n += mDecodedSizes.itemAt(mDecodedSizes.size() - numLoops + i); } mBufferSizes.add(n); // fall through } Loading Loading
media/libstagefright/codecs/aacdec/SoftAAC2.cpp +14 −5 Original line number Diff line number Diff line Loading @@ -654,6 +654,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { inHeader->nOffset += inBufferUsedLength; AAC_DECODER_ERROR decoderErr; int numLoops = 0; do { if (outputDelayRingBufferSpaceLeft() < (mStreamInfo->frameSize * mStreamInfo->numChannels)) { Loading @@ -661,20 +662,19 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { break; } int numconsumed = mStreamInfo->numTotalBytes + mStreamInfo->numBadBytes; int numConsumed = mStreamInfo->numTotalBytes; decoderErr = aacDecoder_DecodeFrame(mAACDecoder, tmpOutBuffer, 2048 * MAX_CHANNEL_COUNT, 0 /* flags */); numconsumed = (mStreamInfo->numTotalBytes + mStreamInfo->numBadBytes) - numconsumed; if (numconsumed != 0) { mDecodedSizes.add(numconsumed); } numConsumed = mStreamInfo->numTotalBytes - numConsumed; numLoops++; if (decoderErr == AAC_DEC_NOT_ENOUGH_BITS) { break; } mDecodedSizes.add(numConsumed); if (decoderErr != AAC_DEC_OK) { ALOGW("aacDecoder_DecodeFrame decoderErr = 0x%4.4x", decoderErr); Loading Loading @@ -716,6 +716,15 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { aacDecoder_SetParam(mAACDecoder, AAC_TPDEC_CLEAR_BUFFER, 1); // After an error, replace the last entry in mBufferSizes with the sum of the // last <numLoops> entries from mDecodedSizes to resynchronize the in/out lists. mBufferSizes.pop(); int n = 0; for (int i = 0; i < numLoops; i++) { n += mDecodedSizes.itemAt(mDecodedSizes.size() - numLoops + i); } mBufferSizes.add(n); // fall through } Loading