summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/matroska
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2012-04-03 12:46:46 -0700
committerJohann <johannkoenig@google.com>2012-04-03 12:46:46 -0700
commitbe7ac3d682729048af27871311808a76c618abdb (patch)
treeb2127ba41f8a1ec044ef6501eb9e99e855750344 /media/libstagefright/matroska
parentd22da88fd555f1262357c7dcdeface8445e3a012 (diff)
downloadframeworks_av-be7ac3d682729048af27871311808a76c618abdb.zip
frameworks_av-be7ac3d682729048af27871311808a76c618abdb.tar.gz
frameworks_av-be7ac3d682729048af27871311808a76c618abdb.tar.bz2
fix crash with cues at the beginning of the file
previous implementation tried to be clever about economizing Cue loads. however, files with the cues at the beginning missed the initial load in the seek function and would crash with a null pointer. Change-Id: I49c15d6688909cd13afabf33a54d9f5896aab7cd
Diffstat (limited to 'media/libstagefright/matroska')
-rw-r--r--media/libstagefright/matroska/MatroskaExtractor.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index 8657d7f..f8c272c 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -346,9 +346,7 @@ void BlockIterator::seek(
long len; long long pos;
pSegment->ParseCues(pEntry->pos, pos, len);
pCues = pSegment->GetCues();
- // Pull one cue point to fix loop below
- ALOGV("Loading Cue points");
- pCues->LoadCuePoint();
+ ALOGV("Cues found");
break;
}
}
@@ -365,16 +363,13 @@ void BlockIterator::seek(
const mkvparser::CuePoint* pCP;
while (!pCues->DoneParsing()) {
- // Make sure we don't have the necessary Cue already.
- // If one Cue hadn't been loaded it would need to pre-emptively
- // load one every time (until they are all loaded).
+ pCues->LoadCuePoint();
pCP = pCues->GetLast();
+
if (pCP->GetTime(pSegment) >= seekTimeNs) {
- ALOGV("Located segment");
+ ALOGV("Parsed past relevant Cue");
break;
}
-
- pCues->LoadCuePoint();
}
// Find the video track for seeking. It doesn't make sense to search the