Bug 1359058: P1. handle EOS during seeking. r=jya draft
authorJW Wang <jwwang@mozilla.com>
Wed, 26 Apr 2017 11:32:50 +0800
changeset 585428 70d09d9c22f462752a6347dfea0763bf5db72e09
parent 585145 1bfa4578aa56f768626ba278a6929e23fc48db54
child 585429 bbe792231c360e3c239fc79f7ebc624681c27933
push id61107
push userbmo:jyavenard@mozilla.com
push dateFri, 26 May 2017 21:28:59 +0000
reviewersjya
bugs1359058
milestone55.0a1
Bug 1359058: P1. handle EOS during seeking. r=jya MozReview-Commit-ID: DPT3t1pi6o1
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1303,16 +1303,22 @@ private:
                  SLOG("OnSeekRejected wait promise rejected");
                  mWaitRequest.Complete();
                  mMaster->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
                })
         ->Track(mWaitRequest);
       return;
     }
 
+    if (aReject.mError == NS_ERROR_DOM_MEDIA_END_OF_STREAM) {
+      HandleEndOfAudio();
+      HandleEndOfVideo();
+      return;
+    }
+
     MOZ_ASSERT(NS_FAILED(aReject.mError),
                "Cancels should also disconnect mSeekRequest");
     mMaster->DecodeError(aReject.mError);
   }
 
   void RequestAudioData()
   {
     MOZ_ASSERT(!mDoneAudioSeeking);