diff options
author | Surajit Podder <spodder@codeaurora.org> | 2013-08-20 05:24:15 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:24:09 -0600 |
commit | 6dff4983e3871650cd0bb220796b1a49236ace91 (patch) | |
tree | 03057b67774493b8897fdd1a43c3a547649b6239 /media/libstagefright/MPEG4Writer.cpp | |
parent | 0102ad6cc8ee58f615803f0b62fba5a4d30796c2 (diff) | |
download | frameworks_av-6dff4983e3871650cd0bb220796b1a49236ace91.zip frameworks_av-6dff4983e3871650cd0bb220796b1a49236ace91.tar.gz frameworks_av-6dff4983e3871650cd0bb220796b1a49236ace91.tar.bz2 |
libstagefright: Use proper ctts offset
Calculate ctts offset as difference between composition
time and decoding time, and avoid adding kMaxCttsOffsetTimeUs
as it increases the sample timestamp by the same amount
which leads to av sync loss for B-frames.
CRs-Fixed: 524739
Change-Id: I75a1bb594536623e3a445af2ee1ceb0cf0926a6e
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-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 fdc58af..df37ea8 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -2328,8 +2328,8 @@ status_t MPEG4Writer::Track::threadEntry() { CHECK(meta_data->findInt64(kKeyDecodingTime, &decodingTimeUs)); decodingTimeUs -= previousPausedDurationUs; cttsOffsetTimeUs = - timestampUs + kMaxCttsOffsetTimeUs - decodingTimeUs; - if (WARN_UNLESS(cttsOffsetTimeUs >= 0ll, "for %s track", trackName)) { + timestampUs - decodingTimeUs; + if (WARN_UNLESS(kMaxCttsOffsetTimeUs >= decodingTimeUs - timestampUs, "for %s track", trackName)) { copy->release(); return ERROR_MALFORMED; } |