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

Commit c5eef081 authored by Robert Shih's avatar Robert Shih
Browse files

Fix NuPlayer::Decoder input buffer loss upon seamless format change

Bug: 19462710
Change-Id: I30f2ab76785a524e95b404b8b18ddc862e9c414e
parent 27a3e954
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -602,11 +602,11 @@ status_t NuPlayer::Decoder::fetchInputData(sp<AMessage> &reply) {
                    // output queue, and handles it in renderer instead.
                    rememberCodecSpecificData(newFormat);
                    onFlush(false /* notifyComplete */);
                    err = OK;
                    continue;
                } else if (seamlessFormatChange) {
                    // reuse existing decoder and don't flush
                    rememberCodecSpecificData(newFormat);
                    err = OK;
                    continue;
                } else {
                    // This stream is unaffected by the discontinuity
                    return -EWOULDBLOCK;
@@ -696,10 +696,7 @@ bool NuPlayer::Decoder::onInputBufferFetched(const sp<AMessage> &msg) {
        int32_t streamErr = ERROR_END_OF_STREAM;
        CHECK(msg->findInt32("err", &streamErr) || !hasBuffer);

        if (streamErr == OK) {
            /* buffers are returned to hold on to */
            return true;
        }
        CHECK(streamErr != OK);

        // attempt to queue EOS
        status_t err = mCodec->queueInputBuffer(