[webm] Don't reject seeks with EOS

The MediaDecoderStateMachine treat seek's EOS as fatal errors, so instead we always resolve the seek promise, and let the next GetSample return EOS.
This commit is contained in:
trav90 2018-10-08 21:44:23 -05:00 committed by Roy Tam
commit 23c04adbe8

View file

@ -963,6 +963,10 @@ WebMTrackDemuxer::Seek(media::TimeUnit aTime)
mParent->SeekInternal(mType, aTime);
nsresult rv = mParent->GetNextPacket(mType, &mSamples);
if (NS_FAILED(rv)) {
if (rv == NS_ERROR_DOM_MEDIA_END_OF_STREAM) {
// Ignore the error for now, the next GetSample will be rejected with EOS.
return SeekPromise::CreateAndResolve(media::TimeUnit(), __func__);
}
return SeekPromise::CreateAndReject(rv, __func__);
}
mNeedKeyframe = true;