Bug 1308066 - remove mLowDataThresholdUsecs. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 05 Oct 2016 16:17:17 +0800
changeset 421423 7ff5b52b582b2ffa5a7b7558589713da49b3707a
parent 421422 94fcf349132bf0ed097f665bc309f71d32e4d935
child 533069 a914a240a1a96c83ea611b31a033c15d5c3db639
push id31490
push userjwwang@mozilla.com
push dateThu, 06 Oct 2016 02:39:07 +0000
bugs1308066
milestone52.0a1
Bug 1308066 - remove mLowDataThresholdUsecs. MozReview-Commit-ID: ZM2v6rsX2U
dom/media/MediaDecoderStateMachine.cpp
dom/media/MediaDecoderStateMachine.h
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1192,18 +1192,16 @@ MediaDecoderStateMachine::MediaDecoderSt
   INIT_CANONICAL(mPlaybackOffset, 0),
   INIT_CANONICAL(mIsAudioDataAudible, false)
 {
   MOZ_COUNT_CTOR(MediaDecoderStateMachine);
   NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
 
   InitVideoQueuePrefs();
 
-  mLowDataThresholdUsecs = detail::LOW_DATA_THRESHOLD_USECS;
-
 #ifdef XP_WIN
   // Ensure high precision timers are enabled on Windows, otherwise the state
   // machine isn't woken up at reliable intervals to set the next frame,
   // and we drop frames while painting. Note that multiple calls to this
   // function per-process is OK, provided each call is matched by a corresponding
   // timeEndPeriod() call.
   timeBeginPeriod(1);
 #endif
@@ -2461,17 +2459,17 @@ bool MediaDecoderStateMachine::OutOfDeco
     return IsAudioDecoding() && !AudioQueue().IsFinished() &&
            AudioQueue().GetSize() == 0 &&
            !mMediaSink->HasUnplayedFrames(TrackInfo::kAudioTrack);
 }
 
 bool MediaDecoderStateMachine::HasLowBufferedData()
 {
   MOZ_ASSERT(OnTaskQueue());
-  return HasLowBufferedData(mLowDataThresholdUsecs);
+  return HasLowBufferedData(detail::LOW_DATA_THRESHOLD_USECS);
 }
 
 bool MediaDecoderStateMachine::HasLowBufferedData(int64_t aUsecs)
 {
   MOZ_ASSERT(OnTaskQueue());
   MOZ_ASSERT(mState >= DECODER_STATE_DECODING,
              "Must have loaded first frame for mBuffered to be valid");
 
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -641,18 +641,16 @@ private:
 
   // The end time of the last decoded video frame. Used to check if we are low
   // on decoded video data.
   int64_t mDecodedVideoEndTime;
 
   // Playback rate. 1.0 : normal speed, 0.5 : two times slower.
   double mPlaybackRate;
 
-  int64_t  mLowDataThresholdUsecs;
-
   // If we've got more than this number of decoded video frames waiting in
   // the video queue, we will not decode any more video frames until some have
   // been consumed by the play state machine thread.
   // Must hold monitor.
   uint32_t GetAmpleVideoFrames() const;
 
   // Low audio threshold. If we've decoded less than this much audio we
   // consider our audio decode "behind", and we may skip video decoding