Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d40663b authored by Pawin Vongmasa's avatar Pawin Vongmasa Committed by Android (Google) Code Review
Browse files

Merge "SoftAAC2: Modified conditions for format change notification after...

Merge "SoftAAC2: Modified conditions for format change notification after decoding each frame." into nyc-dev
parents c3ae7ae5 743aeb89
Loading
Loading
Loading
Loading
+27 −27
Original line number Diff line number Diff line
@@ -767,9 +767,15 @@ void SoftAAC2::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 || mOutputBufferCount > 1) { // TODO: <= 1
                    if (mStreamInfo->sampleRate != prevSampleRate ||
                        mStreamInfo->numChannels != prevNumChannels) {
                if (!mStreamInfo->sampleRate || !mStreamInfo->numChannels) {
                    if ((mInputBufferCount > 2) && (mOutputBufferCount <= 1)) {
                        ALOGW("Invalid AAC stream");
                        mSignalledError = true;
                        notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL);
                        return;
                    }
                } else if ((mStreamInfo->sampleRate != prevSampleRate) ||
                           (mStreamInfo->numChannels != prevNumChannels)) {
                    ALOGI("Reconfiguring decoder: %d->%d Hz, %d->%d channels",
                          prevSampleRate, mStreamInfo->sampleRate,
                          prevNumChannels, mStreamInfo->numChannels);
@@ -788,12 +794,6 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) {
                    }
                    return;
                }
                } else if (!mStreamInfo->sampleRate || !mStreamInfo->numChannels) {
                    ALOGW("Invalid AAC stream");
                    mSignalledError = true;
                    notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL);
                    return;
                }
                if (inHeader && inHeader->nFilledLen == 0) {
                    inInfo->mOwnedByUs = false;
                    mInputBufferCount++;