Bug 1378085 P3 - override Exit(); r?jwwang draft
authorKaku Kuo <kaku@mozilla.com>
Thu, 06 Jul 2017 11:42:27 +0800
changeset 604564 4ad48d7f21617b137cb26a1d9ad031d3ae0553e1
parent 604563 9834697b9e65951c475a496d76da34bbd4677b5c
child 604565 60c8a9666acfc2032da4a36e184e6ce5e5b9d2cc
push id67123
push userbmo:kaku@mozilla.com
push dateThu, 06 Jul 2017 03:57:15 +0000
reviewersjwwang
bugs1378085
milestone56.0a1
Bug 1378085 P3 - override Exit(); r?jwwang MozReview-Commit-ID: 2NW9d4hu3bT
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1036,25 +1036,16 @@ public:
   {
     MOZ_ASSERT(aSeekJob.mTarget->IsAccurate() || aSeekJob.mTarget->IsFast());
     mCurrentTimeBeforeSeek = mMaster->GetMediaTime();
     return SeekingState::Enter(Move(aSeekJob), aVisibility);
   }
 
   void Exit() override
   {
-    if (mSeekJob.Exists() &&
-        mSeekJob.mTarget.isSome() &&
-        mSeekJob.mTarget->IsVideoOnly()) {
-      // We are discarding this video-only seek operation now, and we still need
-      // to dispatch an event so that the UI can change in response to the end
-      // of video-only seek.
-      mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekCompleted);
-    }
-
     // Disconnect MediaDecoder.
     mSeekJob.RejectIfExists(__func__);
 
     // Disconnect MediaDecoderReaderWrapper.
     mSeekRequest.DisconnectIfExists();
 
     mWaitRequest.DisconnectIfExists();
   }
@@ -1779,16 +1770,28 @@ public:
 
     // Dispatch a mozvideoonlyseekbegin event to indicate UI for corresponding
     // changes.
     mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekBegin);
 
     return p.forget();
   }
 
+  void Exit() override
+  {
+    if (mSeekJob.Exists() &&
+        mSeekJob.mTarget.isSome()) {
+      // We are discarding this video-only seek operation now, and we still need
+      // to dispatch an event so that the UI can change in response to the end
+      // of video-only seek.
+      mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekCompleted);
+    }
+
+    AccurateSeekingState::Exit();
+  }
 };
 
 RefPtr<MediaDecoder::SeekPromise>
 MediaDecoderStateMachine::DormantState::HandleSeek(SeekTarget aTarget)
 {
   if (aTarget.IsNextFrame()) {
     // NextFrameSeekingState doesn't reset the decoder unlike
     // AccurateSeekingState. So we first must come out of dormant by seeking to