Bug 1293646: [MSE] P1. Reject seeking attempt with EOS when the mediasource is ended. r=gerald

Otherwise, the ended event would never be fired should the decoder have reached the end of the stream prior endOfStream being called.

MozReview-Commit-ID: CbWCnzi3nxj

--HG--
extra : rebase_source : 729e25919fdb7f8a8918c4d5a9bcae17d8c8bdc5
This commit is contained in:
Jean-Yves Avenard 2016-08-09 23:09:22 +10:00
Родитель 60c4b69563
Коммит aecc883033
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -387,8 +387,9 @@ MediaSourceTrackDemuxer::DoSeek(media::TimeUnit aTime)
if (!buffered.Contains(seekTime)) {
if (!buffered.Contains(aTime)) {
// We don't have the data to seek to.
return SeekPromise::CreateAndReject(DemuxerFailureReason::WAITING_FOR_DATA,
__func__);
return SeekPromise::CreateAndReject(
mManager->IsEnded() ? DemuxerFailureReason::END_OF_STREAM :
DemuxerFailureReason::WAITING_FOR_DATA, __func__);
}
// Theorically we should reject the promise with WAITING_FOR_DATA,
// however, to avoid unwanted regressions we assume that if at this time