diff options
author | Robert Shih <robertshih@google.com> | 2014-11-04 15:22:15 -0800 |
---|---|---|
committer | Robert Shih <robertshih@google.com> | 2014-11-08 01:20:59 +0000 |
commit | 0644f95a8976470e84c6c0a6d96585ae6437ecd2 (patch) | |
tree | 5f1eb04de363ef3637e9caccda1f9133bf4641c9 /media/libstagefright/matroska/MatroskaExtractor.cpp | |
parent | 461b02d3eccefea48fa15c67a9cd3a5895bd2765 (diff) | |
download | frameworks_av-0644f95a8976470e84c6c0a6d96585ae6437ecd2.zip frameworks_av-0644f95a8976470e84c6c0a6d96585ae6437ecd2.tar.gz frameworks_av-0644f95a8976470e84c6c0a6d96585ae6437ecd2.tar.bz2 |
MatroskaExtractor: use GetTrackByNumber instead of GetTrackByIndex
Bug: 18297854
Change-Id: I5e14a358576d9c7d25b7e421cd22428fb17a6e06
Diffstat (limited to 'media/libstagefright/matroska/MatroskaExtractor.cpp')
-rw-r--r-- | media/libstagefright/matroska/MatroskaExtractor.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp index 2587ec7..4f0862c 100644 --- a/media/libstagefright/matroska/MatroskaExtractor.cpp +++ b/media/libstagefright/matroska/MatroskaExtractor.cpp @@ -413,16 +413,16 @@ void BlockIterator::seek( const mkvparser::CuePoint* pCP; mkvparser::Tracks const *pTracks = pSegment->GetTracks(); - unsigned long int trackCount = pTracks->GetTracksCount(); while (!pCues->DoneParsing()) { pCues->LoadCuePoint(); pCP = pCues->GetLast(); CHECK(pCP); + size_t trackCount = mExtractor->mTracks.size(); for (size_t index = 0; index < trackCount; ++index) { - const mkvparser::Track *pTrack = pTracks->GetTrackByIndex(index); + MatroskaExtractor::TrackInfo& track = mExtractor->mTracks.editItemAt(index); + const mkvparser::Track *pTrack = pTracks->GetTrackByNumber(track.mTrackNum); if (pTrack && pTrack->GetType() == 1 && pCP->Find(pTrack)) { // VIDEO_TRACK - MatroskaExtractor::TrackInfo& track = mExtractor->mTracks.editItemAt(index); track.mCuePoints.push_back(pCP); } } @@ -434,12 +434,13 @@ void BlockIterator::seek( } const mkvparser::CuePoint::TrackPosition *pTP = NULL; - const mkvparser::Track *thisTrack = pTracks->GetTrackByIndex(mIndex); + const mkvparser::Track *thisTrack = pTracks->GetTrackByNumber(mTrackNum); if (thisTrack->GetType() == 1) { // video MatroskaExtractor::TrackInfo& track = mExtractor->mTracks.editItemAt(mIndex); pTP = track.find(seekTimeNs); } else { // The Cue index is built around video keyframes + unsigned long int trackCount = pTracks->GetTracksCount(); for (size_t index = 0; index < trackCount; ++index) { const mkvparser::Track *pTrack = pTracks->GetTrackByIndex(index); if (pTrack && pTrack->GetType() == 1 && pCues->Find(seekTimeNs, pTrack, pCP, pTP)) { |