Bug 1306186. Part 1 - remove checks for mIsAudioPrerolling and mIsVideoPrerolling from NeedToSkipToNextKeyframe(). r=kikuo
☠☠ backed out by 5e44ca63f9d9 ☠ ☠
authorJW Wang <jwwang@mozilla.com>
Thu, 29 Sep 2016 11:22:36 +0800
changeset 316161 f0eef1e1acc4ebd20af01b91e3c19c11c684830e
parent 316160 514b26634e4433ccf3ecbf5c151a8f56d87da6c9
child 316162 e70e297b294251f47990804b772947092d06caf5
push id30765
push userphilringnalda@gmail.com
push dateTue, 04 Oct 2016 03:06:46 +0000
treeherdermozilla-central@adb484f84dec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskikuo
bugs1306186
milestone52.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 1306186. Part 1 - remove checks for mIsAudioPrerolling and mIsVideoPrerolling from NeedToSkipToNextKeyframe(). r=kikuo When we reach |isLowOnDecodedAudio = ...|, mMediaSink->IsStarted() must be true which means prerolling is done and both mIsAudioPrerolling and mIsVideoPrerolling are false. MozReview-Commit-ID: Bt1dMw692jI
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -984,22 +984,21 @@ MediaDecoderStateMachine::NeedToSkipToNe
   // audio, or if we're low on video, provided we're not running low on
   // data to decode. If we're running low on downloaded data to decode,
   // we won't start keyframe skipping, as we'll be pausing playback to buffer
   // soon anyway and we'll want to be able to display frames immediately
   // after buffering finishes. We ignore the low audio calculations for
   // readers that are async, as since their audio decode runs on a different
   // task queue it should never run low and skipping won't help their decode.
   bool isLowOnDecodedAudio = !mReader->IsAsync() &&
-                             !mIsAudioPrerolling && IsAudioDecoding() &&
+                             IsAudioDecoding() &&
                              (GetDecodedAudioDuration() <
                               mLowAudioThresholdUsecs * mPlaybackRate);
-  bool isLowOnDecodedVideo = !mIsVideoPrerolling &&
-                             ((GetClock() - mDecodedVideoEndTime) * mPlaybackRate >
-                              LOW_VIDEO_THRESHOLD_USECS);
+  bool isLowOnDecodedVideo = (GetClock() - mDecodedVideoEndTime) * mPlaybackRate >
+                             LOW_VIDEO_THRESHOLD_USECS;
   bool lowBuffered = HasLowBufferedData();
 
   if ((isLowOnDecodedAudio || isLowOnDecodedVideo) && !lowBuffered) {
     DECODER_LOG("Skipping video decode to the next keyframe lowAudio=%d lowVideo=%d lowUndecoded=%d async=%d",
                 isLowOnDecodedAudio, isLowOnDecodedVideo, lowBuffered, mReader->IsAsync());
     return true;
   }