diff options
author | James Dong <jdong@google.com> | 2010-08-24 12:28:02 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-08-24 12:28:02 -0700 |
commit | 40e9940fadf22daa64c1e766fa8a855c7b149c17 (patch) | |
tree | 07330937db6955d716c6df77c03c0bff74143e56 /media | |
parent | 01f0908b3e8c759a9fcd565f6bc6cc6c4033678f (diff) | |
download | frameworks_av-40e9940fadf22daa64c1e766fa8a855c7b149c17.zip frameworks_av-40e9940fadf22daa64c1e766fa8a855c7b149c17.tar.gz frameworks_av-40e9940fadf22daa64c1e766fa8a855c7b149c17.tar.bz2 |
Make sure that timestamp does not go backward in MP4 file writer
Change-Id: I90745b9df7f19d61f3ab826bf9d2419fe788554e
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index e36d9fe..a15b84e 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -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 } |