summaryrefslogtreecommitdiff
path: root/dom/media/webm
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-08 21:44:23 -0500
committertrav90 <travawine@palemoon.org>2018-10-08 21:44:23 -0500
commitb6885b39ae9c43c68193d113ecdc83cdb91c1fbf (patch)
treea6bfcedf41f5c3faf6cbe5b101830a10f903879b /dom/media/webm
parent03d616ac6fee5c3795dc0ff6b01b72ea4223edb0 (diff)
downloaduxp-b6885b39ae9c43c68193d113ecdc83cdb91c1fbf.tar.gz
[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.
Diffstat (limited to 'dom/media/webm')
-rw-r--r--dom/media/webm/WebMDemuxer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/dom/media/webm/WebMDemuxer.cpp b/dom/media/webm/WebMDemuxer.cpp
index 395262a2ef..b54739c06a 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;