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

Commit 0b6e47ad authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "ACodec: free buffers when allocateBuffers failed."

parents 7ee3db58 c673de80
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5906,6 +5906,15 @@ void ACodec::LoadedToIdleState::stateEntered() {

        mCodec->signalError(OMX_ErrorUndefined, makeNoSideEffectStatus(err));

        mCodec->mOMX->sendCommand(
                mCodec->mNode, OMX_CommandStateSet, OMX_StateLoaded);
        if (mCodec->allYourBuffersAreBelongToUs(kPortIndexInput)) {
            mCodec->freeBuffersOnPort(kPortIndexInput);
        }
        if (mCodec->allYourBuffersAreBelongToUs(kPortIndexOutput)) {
            mCodec->freeBuffersOnPort(kPortIndexOutput);
        }

        mCodec->changeState(mCodec->mLoadedState);
    }
}