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
gugelfrei
Chong Zhang 6 years ago
parent 70c2e5ea61
commit d62d30773d

@ -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;
}

Loading…
Cancel
Save