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

Commit 7256509c authored by Shalaj Jain's avatar Shalaj Jain Committed by Linux Build Service Account
Browse files

nuplayer: handle error from MediaCodec in Decoder handleAnOutputBuffer

MediaCodec could send out message of output buffer available right before
it hits an error and clears its buffers.

Change-Id: I1b11c88cdcb3fca7ddd6103c6d3d28642304f079
parent 1e1e5263
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -565,6 +565,11 @@ bool NuPlayer::Decoder::handleAnOutputBuffer(
    sp<ABuffer> buffer;
    mCodec->getOutputBuffer(index, &buffer);

    if (buffer == NULL) {
        handleError(UNKNOWN_ERROR);
        return false;
    }

    if (index >= mOutputBuffers.size()) {
        for (size_t i = mOutputBuffers.size(); i <= index; ++i) {
            mOutputBuffers.add();