Bug 1347538: Don't reject seeks with EOS. r=kinetik
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 24 Mar 2017 18:36:50 +0100
changeset 349959 e86850951152d047c10a2e1f134fc126cea44aec
parent 349958 4a00e1ca8f4730ecab3142471e849bfdd213cbc6
child 349960 3c201a39f5df2b4dd1d9c368dc35ae471d142342
push id31564
push usercbook@mozilla.com
push dateTue, 28 Mar 2017 11:01:29 +0000
treeherdermozilla-central@bf0f89726139 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1347538
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1347538: Don't reject seeks with EOS. r=kinetik The MediaDecoderStateMachine treat seek's EOS as fatal errors, so instead we always resolve the seek promise, and let the next GetSample return EOS. MozReview-Commit-ID: 6MGaJ3C8xrH
dom/media/webm/WebMDemuxer.cpp
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -1068,16 +1068,20 @@ WebMTrackDemuxer::Seek(const media::Time
   // Seeks to aTime. Upon success, SeekPromise will be resolved with the
   // actual time seeked to. Typically the random access point time
 
   media::TimeUnit seekTime = aTime;
   mSamples.Reset();
   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;
 
   // Check what time we actually seeked to.
   if (mSamples.GetSize() > 0) {
     const RefPtr<MediaRawData>& sample = mSamples.First();
     seekTime = media::TimeUnit::FromMicroseconds(sample->mTime);