Bug 1352319. P5 - rename AudioPrerollUsecs and let it return a TimeUnit. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 28 Mar 2017 15:42:09 +0800
changeset 554254 72536abcb5c16eef6529f6d5e9c2e19d60d719b2
parent 554253 6dbf68a6eb09f29e70a7c2e111a862d78ec43b50
child 554255 f52044128c554b7f491f183731c35d047d5afbd9
push id51883
push userjwwang@mozilla.com
push dateFri, 31 Mar 2017 09:16:07 +0000
bugs1352319
milestone55.0a1
Bug 1352319. P5 - rename AudioPrerollUsecs and let it return a TimeUnit. MozReview-Commit-ID: C3IdeNksQjn
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -838,31 +838,31 @@ private:
   }
 
   // At the start of decoding we want to "preroll" the decode until we've
   // got a few frames decoded before we consider whether decode is falling
   // behind. Otherwise our "we're falling behind" logic will trigger
   // unnecessarily if we start playing as soon as the first sample is
   // decoded. These two fields store how many video frames and audio
   // samples we must consume before are considered to be finished prerolling.
-  uint32_t AudioPrerollUsecs() const
+  TimeUnit AudioPrerollThreshold() const
   {
-    return mMaster->mAmpleAudioThreshold.ToMicroseconds() / 2;
+    return mMaster->mAmpleAudioThreshold / 2;
   }
 
   uint32_t VideoPrerollFrames() const
   {
     return mMaster->GetAmpleVideoFrames() / 2;
   }
 
   bool DonePrerollingAudio()
   {
     return !mMaster->IsAudioDecoding()
            || mMaster->GetDecodedAudioDuration()
-              >= AudioPrerollUsecs() * mMaster->mPlaybackRate;
+              >= AudioPrerollThreshold().ToMicroseconds() * mMaster->mPlaybackRate;
   }
 
   bool DonePrerollingVideo()
   {
     return !mMaster->IsVideoDecoding()
            || static_cast<uint32_t>(mMaster->VideoQueue().GetSize())
               >= VideoPrerollFrames() * mMaster->mPlaybackRate + 1;
   }