Bug 1299074. Part 2 - simplify the handling of pending seek in StartDecoding(). r=kaku
authorJW Wang <jwwang@mozilla.com>
Tue, 30 Aug 2016 16:21:43 +0800
changeset 312180 0e2ee827b4be3a090ee0bc3aae2d1e335e37506a
parent 312179 bf568dfa5fd1da97dbee94a55c36dddaf118f15f
child 312181 13ca0eb5671e034c0c689262218a6fa98d54867a
push id31913
push userjwwang@mozilla.com
push dateThu, 01 Sep 2016 03:39:16 +0000
treeherderautoland@0dfbee74cdbb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1299074
milestone51.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 1299074. Part 2 - simplify the handling of pending seek in StartDecoding(). r=kaku mSentFirstFrameLoadedEvent is sufficient to tell us whether we can handle the pending seek now or later. MozReview-Commit-ID: KzDd2brvKPA
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1255,29 +1255,21 @@ MediaDecoderStateMachine::Shutdown()
 }
 
 void
 MediaDecoderStateMachine::StartDecoding()
 {
   MOZ_ASSERT(OnTaskQueue());
   MOZ_ASSERT(mState == DECODER_STATE_DECODING);
 
-  if (mDecodingFirstFrame && mSentFirstFrameLoadedEvent) {
-    // We're resuming from dormant state, so we don't need to request
-    // the first samples in order to determine the media start time,
-    // we have the start time from last time we loaded.
-    // FinishDecodeFirstFrame will be launched upon completion of the seek when
-    // we have data ready to play.
-    MOZ_ASSERT(mQueuedSeek.Exists() && mSentFirstFrameLoadedEvent,
-               "Return from dormant must have queued seek");
-
-    if (mQueuedSeek.Exists()) {
-      InitiateSeek(Move(mQueuedSeek));
-      return;
-    }
+  // Handle the pending seek now if we've decoded first frames. Otherwise it
+  // will be handled after decoding first frames.
+  if (mSentFirstFrameLoadedEvent && mQueuedSeek.Exists()) {
+    InitiateSeek(Move(mQueuedSeek));
+    return;
   }
 
   if (CheckIfDecodeComplete()) {
     SetState(DECODER_STATE_COMPLETED);
     return;
   }
 
   mDecodeStartTime = TimeStamp::Now();