Bug 1351203. P2 - rename the variable and fix comments. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 28 Mar 2017 14:46:34 +0800
changeset 553973 073edc2d4721fbddceeed6980a538fada1bba90f
parent 553972 e44b6882ccd3f9ecc25f28404bf0c48ae07b41df
child 553977 055259e5d55f456ab63cf425503dcc53a827f4e7
push id51852
push userjwwang@mozilla.com
push dateFri, 31 Mar 2017 05:30:35 +0000
bugs1351203
milestone55.0a1
Bug 1351203. P2 - rename the variable and fix comments. MozReview-Commit-ID: Bs2uanapqR9
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -104,21 +104,21 @@ static constexpr auto AMPLE_AUDIO_THRESH
 
 } // namespace detail
 
 // If we have fewer than LOW_VIDEO_FRAMES decoded frames, and
 // we're not "prerolling video", we'll skip the video up to the next keyframe
 // which is at or after the current playback position.
 static const uint32_t LOW_VIDEO_FRAMES = 2;
 
-// Threshold in usecs that used to check if we are low on decoded video.
+// Threshold that used to check if we are low on decoded video.
 // If the last video frame's end time |mDecodedVideoEndTime| is more than
-// |LOW_VIDEO_THRESHOLD_USECS*mPlaybackRate| after the current clock in
+// |LOW_VIDEO_THRESHOLD*mPlaybackRate| after the current clock in
 // Advanceframe(), the video decode is lagging, and we skip to next keyframe.
-static constexpr auto LOW_VIDEO_THRESHOLD_USECS = TimeUnit::FromMicroseconds(60000);
+static constexpr auto LOW_VIDEO_THRESHOLD = TimeUnit::FromMicroseconds(60000);
 
 // Arbitrary "frame duration" when playing only audio.
 static const int AUDIO_DURATION_USECS = 40000;
 
 // If we increase our "low audio threshold" (see LOW_AUDIO_THRESHOLD above), we
 // use this as a factor in all our calculations. Increasing this will cause
 // us to be more likely to increase our low audio threshold, and to
 // increase it by more.
@@ -2301,17 +2301,17 @@ DecodingState::NeedToSkipToNextKeyframe(
   bool isLowOnDecodedAudio =
     !Reader()->IsAsync()
     && mMaster->IsAudioDecoding()
     && (mMaster->GetDecodedAudioDuration()
         < mMaster->mLowAudioThreshold.ToMicroseconds() * mMaster->mPlaybackRate);
   bool isLowOnDecodedVideo =
     (mMaster->GetClock() - mMaster->mDecodedVideoEndTime)
     * mMaster->mPlaybackRate
-    > LOW_VIDEO_THRESHOLD_USECS.ToMicroseconds();
+    > LOW_VIDEO_THRESHOLD.ToMicroseconds();
   bool lowBuffered = mMaster->HasLowBufferedData();
 
   if ((isLowOnDecodedAudio || isLowOnDecodedVideo) && !lowBuffered) {
     SLOG("Skipping video decode to the next keyframe lowAudio=%d lowVideo=%d "
          "lowUndecoded=%d async=%d",
          isLowOnDecodedAudio, isLowOnDecodedVideo, lowBuffered,
          Reader()->IsAsync());
     return true;