Loading media/libstagefright/codecs/aacdec/SoftAAC2.cpp +201 −208 Original line number Diff line number Diff line Loading @@ -493,6 +493,7 @@ int32_t SoftAAC2::outputDelayRingBufferSamplesLeft() { return mOutputDelayRingBufferSize - outputDelayRingBufferSamplesAvailable(); } void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { if (mSignalledError || mOutputPortSettingsChange != NONE) { return; Loading @@ -505,7 +506,15 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (portIndex == 0 && mInputBufferCount == 0) { while ((!inQueue.empty() || mEndOfInput) && !outQueue.empty()) { if (!inQueue.empty()) { INT_PCM tmpOutBuffer[2048 * MAX_CHANNEL_COUNT]; BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; mEndOfInput = (inHeader->nFlags & OMX_BUFFERFLAG_EOS) != 0; if (portIndex == 0 && (inHeader->nFlags & OMX_BUFFERFLAG_CODECCONFIG) != 0) { BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; Loading @@ -529,6 +538,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { inInfo->mOwnedByUs = false; inQueue.erase(inQueue.begin()); mLastInHeader = NULL; inInfo = NULL; notifyEmptyBufferDone(inHeader); inHeader = NULL; Loading @@ -544,22 +554,9 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { notify(OMX_EventPortSettingsChanged, 1, 0, NULL); mOutputPortSettingsChange = AWAITING_DISABLED; } return; } while ((!inQueue.empty() || mEndOfInput) && !outQueue.empty()) { if (!inQueue.empty()) { INT_PCM tmpOutBuffer[2048 * MAX_CHANNEL_COUNT]; BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) { mEndOfInput = true; } else { mEndOfInput = false; } if (inHeader->nFilledLen == 0) { inInfo->mOwnedByUs = false; inQueue.erase(inQueue.begin()); Loading @@ -567,7 +564,9 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { inInfo = NULL; notifyEmptyBufferDone(inHeader); inHeader = NULL; } else { continue; } if (mIsADTS) { size_t adtsHeaderSize = 0; // skip 30 bits, aac_frame_length follows. Loading Loading @@ -609,12 +608,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { if (signalError) { mSignalledError = true; notify(OMX_EventError, OMX_ErrorStreamCorrupt, ERROR_MALFORMED, NULL); notify(OMX_EventError, OMX_ErrorStreamCorrupt, ERROR_MALFORMED, NULL); return; } } else { Loading Loading @@ -759,7 +753,6 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { ALOGV("inHeader->nFilledLen = %d", inHeader->nFilledLen); } } } int32_t outputDelay = mStreamInfo->outputDelay * mStreamInfo->numChannels; Loading Loading
media/libstagefright/codecs/aacdec/SoftAAC2.cpp +201 −208 Original line number Diff line number Diff line Loading @@ -493,6 +493,7 @@ int32_t SoftAAC2::outputDelayRingBufferSamplesLeft() { return mOutputDelayRingBufferSize - outputDelayRingBufferSamplesAvailable(); } void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { if (mSignalledError || mOutputPortSettingsChange != NONE) { return; Loading @@ -505,7 +506,15 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (portIndex == 0 && mInputBufferCount == 0) { while ((!inQueue.empty() || mEndOfInput) && !outQueue.empty()) { if (!inQueue.empty()) { INT_PCM tmpOutBuffer[2048 * MAX_CHANNEL_COUNT]; BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; mEndOfInput = (inHeader->nFlags & OMX_BUFFERFLAG_EOS) != 0; if (portIndex == 0 && (inHeader->nFlags & OMX_BUFFERFLAG_CODECCONFIG) != 0) { BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; Loading @@ -529,6 +538,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { inInfo->mOwnedByUs = false; inQueue.erase(inQueue.begin()); mLastInHeader = NULL; inInfo = NULL; notifyEmptyBufferDone(inHeader); inHeader = NULL; Loading @@ -544,22 +554,9 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { notify(OMX_EventPortSettingsChanged, 1, 0, NULL); mOutputPortSettingsChange = AWAITING_DISABLED; } return; } while ((!inQueue.empty() || mEndOfInput) && !outQueue.empty()) { if (!inQueue.empty()) { INT_PCM tmpOutBuffer[2048 * MAX_CHANNEL_COUNT]; BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) { mEndOfInput = true; } else { mEndOfInput = false; } if (inHeader->nFilledLen == 0) { inInfo->mOwnedByUs = false; inQueue.erase(inQueue.begin()); Loading @@ -567,7 +564,9 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { inInfo = NULL; notifyEmptyBufferDone(inHeader); inHeader = NULL; } else { continue; } if (mIsADTS) { size_t adtsHeaderSize = 0; // skip 30 bits, aac_frame_length follows. Loading Loading @@ -609,12 +608,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { if (signalError) { mSignalledError = true; notify(OMX_EventError, OMX_ErrorStreamCorrupt, ERROR_MALFORMED, NULL); notify(OMX_EventError, OMX_ErrorStreamCorrupt, ERROR_MALFORMED, NULL); return; } } else { Loading Loading @@ -759,7 +753,6 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { ALOGV("inHeader->nFilledLen = %d", inHeader->nFilledLen); } } } int32_t outputDelay = mStreamInfo->outputDelay * mStreamInfo->numChannels; Loading