From 81c39ba87667566a83febdc8c22e300ea8313897 Mon Sep 17 00:00:00 2001 From: trav90 Date: Mon, 8 Oct 2018 21:44:23 -0500 Subject: [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. --- dom/media/webm/WebMDemuxer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dom/media') diff --git a/dom/media/webm/WebMDemuxer.cpp b/dom/media/webm/WebMDemuxer.cpp index 395262a2e..b54739c06 100644 --- a/dom/media/webm/WebMDemuxer.cpp +++ b/dom/media/webm/WebMDemuxer.cpp @@ -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; -- cgit v1.2.3