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

Commit 5191a23c authored by Wonsik Kim's avatar Wonsik Kim Committed by gitbuildkicker
Browse files

Revert "media: Mediarecorder drops the mediabuffer with negative adjusted timestamp."

This reverts commit 901ca36b.

Change-Id: I56a0ec7b8d70e19cc6009d8fbc4560becf1d04c9
parent 5582823a
Loading
Loading
Loading
Loading
+3 −19
Original line number Diff line number Diff line
@@ -648,15 +648,6 @@ status_t MediaCodecSource::feedEncoderInputBuffers() {
            CHECK(mbuf->meta_data()->findInt64(kKeyTime, &timeUs));
            timeUs += mInputBufferTimeOffsetUs;

            // Due to the extra delay adjustment at the beginning of start/resume,
            // the adjusted timeUs may be negative if MediaCodecSource goes into pause
            // state before feeding any buffers to the encoder. Drop the buffer in this
            // case.
            if (timeUs < 0) {
                mbuf->release();
                return OK;
            }

            // push decoding time for video, or drift time for audio
            if (mIsVideo) {
                mDecodingTimeQueue.push_back(timeUs);
@@ -841,16 +832,9 @@ void MediaCodecSource::onMessageReceived(const sp<AMessage> &msg) {
                        // Time offset is not applied at
                        // feedEncoderInputBuffer() in surface input case.
                        timeUs += mInputBufferTimeOffsetUs;

                        // Due to the extra delay adjustment at the beginning of
                        // start/resume, the adjusted timeUs may be negative if
                        // MediaCodecSource goes into pause state before feeding
                        // any buffers to the encoder. Drop the buffer in this case.
                        if (timeUs < 0) {
                            mEncoder->releaseOutputBuffer(index);
                            break;
                        }

                        // GraphicBufferSource is supposed to discard samples
                        // queued before start, and offset timeUs by start time
                        CHECK_GE(timeUs, 0ll);
                        // TODO:
                        // Decoding time for surface source is unavailable,
                        // use presentation time for now. May need to move