Bug 1306186. Part 6 - check if we can stop prerolling in the entry action of DecodingState. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 03 Oct 2016 18:02:57 +0800
changeset 420111 98d128872bbe32bb057942e0d0830b5f580f7f1a
parent 420066 d9ea0e523c33ccff9f4177baa196ad3093308b8d
child 532721 34dd42c84f46d007b2c187ebc964fc664352f80c
push id31095
push userjwwang@mozilla.com
push dateMon, 03 Oct 2016 10:03:45 +0000
bugs1306186
milestone52.0a1
Bug 1306186. Part 6 - check if we can stop prerolling in the entry action of DecodingState. Chances are we've decoded enough data when entering DecodingState. Otherwis we will never start playback. MozReview-Commit-ID: AMdd4xxQt6c
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -438,16 +438,17 @@ public:
     if (mMaster->CheckIfDecodeComplete()) {
       SetState(DECODER_STATE_COMPLETED);
       return;
     }
 
     mDecodeStartTime = TimeStamp::Now();
 
     mMaster->mIsPrerolling = true;
+    mMaster->MaybeStopPrerolling();
 
     // Ensure that we've got tasks enqueued to decode data if we need to.
     mMaster->DispatchDecodeTasksIfNeeded();
 
     mMaster->ScheduleStateMachine();
   }
 
   void Exit() override