Bug 1238347 - stop prerolling when decoding starts if we are waiting for data. r=cpearce. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 11 Jan 2016 06:44:44 +0800
changeset 320335 bcfa8145cff388644453df36b8891c40cff8d3c0
parent 320334 7ef56dda0d074bc6819149a52a96947a5b466976
child 320364 861179f6bbd5eeb591c3be04c54a17422a627686
child 320383 d930e0c4c8e1348065a08e5dbba8fa4afbe08139
push id9173
push userjwwang@mozilla.com
push dateSun, 10 Jan 2016 22:46:31 +0000
reviewerscpearce
bugs1238347
milestone46.0a1
Bug 1238347 - stop prerolling when decoding starts if we are waiting for data. r=cpearce.
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1387,18 +1387,18 @@ void MediaDecoderStateMachine::StartDeco
   mDecodeStartTime = TimeStamp::Now();
 
   CheckIfDecodeComplete();
   if (mState == DECODER_STATE_COMPLETED) {
     return;
   }
 
   // Reset other state to pristine values before starting decode.
-  mIsAudioPrerolling = !DonePrerollingAudio();
-  mIsVideoPrerolling = !DonePrerollingVideo();
+  mIsAudioPrerolling = !DonePrerollingAudio() && !mAudioWaitRequest.Exists();
+  mIsVideoPrerolling = !DonePrerollingVideo() && !mVideoWaitRequest.Exists();
 
   // Ensure that we've got tasks enqueued to decode data if we need to.
   DispatchDecodeTasksIfNeeded();
 
   ScheduleStateMachine();
 }
 
 void MediaDecoderStateMachine::PlayStateChanged()