Bug 1258922: [MSE] P3. Check that the data we are attempting to skip to is buffered. r=gerald

MozReview-Commit-ID: DCQkIimciEe
This commit is contained in:
Jean-Yves Avenard 2016-05-05 15:43:40 +10:00
Родитель 55e5e7da77
Коммит b2b17692f7
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -462,11 +462,17 @@ MediaSourceTrackDemuxer::DoGetSamples(int32_t aNumSamples)
RefPtr<MediaSourceTrackDemuxer::SkipAccessPointPromise>
MediaSourceTrackDemuxer::DoSkipToNextRandomAccessPoint(media::TimeUnit aTimeThreadshold)
{
bool found;
uint32_t parsed =
mManager->SkipToNextRandomAccessPoint(mType, aTimeThreadshold, found);
if (found) {
return SkipAccessPointPromise::CreateAndResolve(parsed, __func__);
uint32_t parsed = 0;
// Ensure that the data we are about to skip to is still available.
TimeIntervals buffered = mManager->Buffered(mType);
buffered.SetFuzz(MediaSourceDemuxer::EOS_FUZZ);
if (buffered.Contains(aTimeThreadshold)) {
bool found;
parsed =
mManager->SkipToNextRandomAccessPoint(mType, aTimeThreadshold, found);
if (found) {
return SkipAccessPointPromise::CreateAndResolve(parsed, __func__);
}
}
SkipFailureHolder holder(
mManager->IsEnded() ? DemuxerFailureReason::END_OF_STREAM :