Merge "Make sure that timestamp does not go backward in MP4 file writer" into gingerbread

This commit is contained in:
James Dong
2010-08-26 09:47:12 -07:00
committed by Android (Google) Code Review

View File

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