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

Commit b9e82298 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SoftXaac: Handle error cases when decoder fails to initialize" into pi-dev

parents 306a0690 ec1a9b52
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -689,7 +689,6 @@ void SoftXAAC::onQueueFilled(OMX_U32 /* portIndex */) {
                    notify(OMX_EventError, OMX_ErrorUndefined, err_code, NULL);
                    return;
                }
                mIsCodecConfigFlushRequired = true;
            }

            if (!mSampFreq || !mNumChannels) {
@@ -713,10 +712,14 @@ void SoftXAAC::onQueueFilled(OMX_U32 /* portIndex */) {
            signed int bytesConsumed = 0;
            int errorCode = 0;
            if (mIsCodecInitialized) {
                mIsCodecConfigFlushRequired = true;
                errorCode =
                    decodeXAACStream(inBuffer, inBufferLength, &bytesConsumed, &numOutBytes);
            } else {
            } else if (!mIsCodecConfigFlushRequired) {
                ALOGW("Assumption that first frame after header initializes decoder failed!");
                mSignalledError = true;
                notify(OMX_EventError, OMX_ErrorUndefined, -1, NULL);
                return;
            }
            inHeader->nFilledLen -= bytesConsumed;
            inHeader->nOffset += bytesConsumed;