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

Commit d62d3077 authored by Chong Zhang's avatar Chong Zhang
Browse files

stagefright: send EOS to encoder for thumbnail extraction

Decoders might hold on to decoded frames for certain streams,
send EOS after last sample so that we get all output frames.

bug: 110116757
bug: 110226430

Test: CTS HeifWriterTest; MediaMetadataRetrieverTest
Change-Id: I0f8e7f1607857297325594adad8ca4fbff16e5e9
parent 70c2e5ea
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -301,10 +301,13 @@ status_t FrameDecoder::extractInternal() {
            err = mSource->read(&mediaBuffer, &mReadOptions);
            mReadOptions.clearSeekTo();
            if (err != OK) {
                ALOGW("Input Error or EOS");
                mHaveMoreInputs = false;
                if (!mFirstSample && err == ERROR_END_OF_STREAM) {
                    (void)mDecoder->queueInputBuffer(
                            index, 0, 0, 0, MediaCodec::BUFFER_FLAG_EOS);
                    err = OK;
                } else {
                    ALOGW("Input Error: err=%d", err);
                }
                break;
            }