diff options
author | Marco Nelissen <marcone@google.com> | 2014-06-17 14:48:32 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2014-06-23 10:24:14 -0700 |
commit | c1f4b2b73fe9432cb75ce1dd368475a2867e70ed (patch) | |
tree | 88b7af43ca9c2d1752a28c602bacb4adc38e6172 /media/libstagefright/AwesomePlayer.cpp | |
parent | 7a4d7d6670f1766442b54045fb420dbf42b75750 (diff) | |
download | frameworks_av-c1f4b2b73fe9432cb75ce1dd368475a2867e70ed.zip frameworks_av-c1f4b2b73fe9432cb75ce1dd368475a2867e70ed.tar.gz frameworks_av-c1f4b2b73fe9432cb75ce1dd368475a2867e70ed.tar.bz2 |
Parse trex and mehd boxes
Also get duration from mvhd if available, use that in addition to track
durations to determine total length of file, clear track header
struct so we don't read uninitialized garbage from it, and take
composition time offset into account for proper ordering when B frames
are used.
b/15669839
Change-Id: Ibf3e35b5c7299bac11d0e78a391545fc325dd2d0
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index d679be1..f35a5b1 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -408,6 +408,13 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) { totalBitRate += bitrate; } + sp<MetaData> fileMeta = mExtractor->getMetaData(); + if (fileMeta != NULL) { + int64_t duration; + if (fileMeta->findInt64(kKeyDuration, &duration)) { + mDurationUs = duration; + } + } mBitrate = totalBitRate; |