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

Commit 05e80b4c authored by James Dong's avatar James Dong
Browse files

Make sure that timestamp does not go backward in MP4 file writer

Change-Id: I90745b9df7f19d61f3ab826bf9d2419fe788554e
parent 3e22ef1e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1569,9 +1569,9 @@ status_t MPEG4Writer::Track::threadEntry() {
                // The idea here is to avoid having two or more samples with the
                // same timestamp in the output file.
                if (mTimeScale >= 1000000LL) {
                    timestampUs += 1;
                    timestampUs = lastTimestampUs + 1;
                } else {
                    timestampUs += (1000000LL + (mTimeScale >> 1)) / mTimeScale;
                    timestampUs = lastTimestampUs + (1000000LL + (mTimeScale >> 1)) / mTimeScale;
                }
#endif
            }