Bug 1314884. Part 2 - Let DORMANT transition to SEEKING when play state changes to PLAYING since we need to seek anyway whenever exiting dormant. r=kaku
authorJW Wang <jwwang@mozilla.com>
Thu, 03 Nov 2016 15:02:22 +0800
changeset 351717 3bcc70c0259f6872e5c8e53edf15ae8dc4a46bd7
parent 351716 268128dac27756b156bfcf630829e67684082302
child 351718 32223527f7f8f0f793e2dd1adab60b9269cbeba7
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1314884
milestone52.0a1
Bug 1314884. Part 2 - Let DORMANT transition to SEEKING when play state changes to PLAYING since we need to seek anyway whenever exiting dormant. r=kaku MozReview-Commit-ID: 9d7Gea1iclh
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -389,18 +389,17 @@ public:
 private:
   SeekJob mPendingSeek;
 };
 
 /**
  * Purpose: release decoder resources to save memory and hardware resources.
  *
  * Transition to:
- *   DECODING_FIRSTFRAME when play state changes to PLAYING.
- *   SEEKING if any seek request.
+ *   SEEKING if any seek request or play state changes to PLAYING.
  */
 class MediaDecoderStateMachine::DormantState
   : public MediaDecoderStateMachine::StateObject
 {
 public:
   explicit DormantState(Master* aPtr) : StateObject(aPtr) {}
 
   void Enter()
@@ -1290,17 +1289,18 @@ DormantState::HandleSeek(SeekTarget aTar
 
 void
 MediaDecoderStateMachine::
 DormantState::HandlePlayStateChanged(MediaDecoder::PlayState aPlayState)
 {
   if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
     // Exit dormant when the user wants to play.
     MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy);
-    SetState<DecodingFirstFrameState>(Move(mPendingSeek));
+    MOZ_ASSERT(mMaster->mSentFirstFrameLoadedEvent);
+    SetState<SeekingState>(Move(mPendingSeek));
   }
 }
 
 void
 MediaDecoderStateMachine::
 WaitForCDMState::HandleCDMProxyReady()
 {
   SetState<DecodingFirstFrameState>(Move(mPendingSeek));