diff options
author | Andreas Huber <andih@google.com> | 2009-10-08 10:07:49 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-10-12 16:00:07 -0700 |
commit | 48c948b1137e7bbdb161b51908657ab72ac5e2da (patch) | |
tree | 93382f5cf363010d79ea26d9e44e6470821f1658 /media/libstagefright/MPEG4Writer.cpp | |
parent | d3eaeefb1bac68bc1fee91b794be2c2c3bea6d94 (diff) | |
download | frameworks_av-48c948b1137e7bbdb161b51908657ab72ac5e2da.zip frameworks_av-48c948b1137e7bbdb161b51908657ab72ac5e2da.tar.gz frameworks_av-48c948b1137e7bbdb161b51908657ab72ac5e2da.tar.bz2 |
Change to a int64_t usecs representation for timestamps and duration throughout stagefright.
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index fa35768..9a7a873 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -399,15 +399,11 @@ void MPEG4Writer::Track::threadEntry() { info.size = buffer->range_length(); info.offset = offset; - int32_t units, scale; - bool success = - buffer->meta_data()->findInt32(kKeyTimeUnits, &units); - CHECK(success); - success = - buffer->meta_data()->findInt32(kKeyTimeScale, &scale); - CHECK(success); - - info.timestamp = (int64_t)units * 1000 / scale; + int64_t timestampUs; + CHECK(buffer->meta_data()->findInt64(kKeyTime, ×tampUs)); + + // Our timestamp is in ms. + info.timestamp = (timestampUs + 500) / 1000; mSampleInfos.push_back(info); |