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

Commit bc03dbeb authored by Hangyu Kuang's avatar Hangyu Kuang Committed by Android (Google) Code Review
Browse files

Merge "media: Save the last decode timestamp after all the timestamp adjustments."

parents 24a8da67 38f4cbed
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2748,9 +2748,11 @@ status_t MPEG4Writer::Track::threadEntry() {
            if (mLastDecodingTimeUs < 0) {
                decodingTimeUs = std::max((int64_t)0, decodingTimeUs);
            } else {
                // increase decoding time by at least 1 tick
                decodingTimeUs = std::max(
                        mLastDecodingTimeUs + divUp(1000000, mTimeScale), decodingTimeUs);
                // increase decoding time by at least the larger vaule of 1 tick and
                // 0.1 milliseconds. This needs to take into account the possible
                // delta adjustment in DurationTicks in below.
                decodingTimeUs = std::max(mLastDecodingTimeUs +
                        std::max(100, divUp(1000000, mTimeScale)), decodingTimeUs);
            }

            mLastDecodingTimeUs = decodingTimeUs;