Bug 1277188. Part 3 - remove AudioClock::GetPositionUnlocked(). r=kinetik. draft 1274214_remove_WMFMediaDataDecoder_TaskQueue
authorJW Wang <jwwang@mozilla.com>
Wed, 01 Jun 2016 16:30:54 +0800
branch1274214_remove_WMFMediaDataDecoder_TaskQueue
changeset 374965 216e0a7e9909572ad828c262063e348df462a5ef
parent 374964 d3b177d25a86f03ac65c5231dc389e66cbb5aba5
child 374966 8208e3ead2d8dfbe02fb899e5fb376651715be61
push id20123
push userjwwang@mozilla.com
push dateFri, 03 Jun 2016 03:02:34 +0000
reviewerskinetik
bugs1277188
milestone49.0a1
Bug 1277188. Part 3 - remove AudioClock::GetPositionUnlocked(). r=kinetik. MozReview-Commit-ID: 9g3wqI63OsR
dom/media/AudioStream.cpp
dom/media/AudioStream.h
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -660,24 +660,16 @@ void AudioClock::Init()
   mInRate = mAudioStream->GetRate();
 }
 
 void AudioClock::UpdateFrameHistory(uint32_t aServiced, uint32_t aUnderrun)
 {
   mFrameHistory->Append(aServiced, aUnderrun, mOutRate);
 }
 
-int64_t AudioClock::GetPositionUnlocked() const
-{
-  // GetPositionInFramesUnlocked() asserts it owns the monitor
-  int64_t frames = mAudioStream->GetPositionInFramesUnlocked();
-  NS_ASSERTION(frames < 0 || (mInRate != 0 && mOutRate != 0), "AudioClock not initialized.");
-  return frames >= 0 ? mFrameHistory->GetPosition(frames) : -1;
-}
-
 int64_t AudioClock::GetPositionInFrames(int64_t frames) const
 {
   return (GetPosition(frames) * mInRate) / USECS_PER_S;
 }
 
 int64_t AudioClock::GetPosition(int64_t frames) const
 {
   return mFrameHistory->GetPosition(frames);
--- a/dom/media/AudioStream.h
+++ b/dom/media/AudioStream.h
@@ -37,21 +37,16 @@ class AudioClock
 public:
   explicit AudioClock(AudioStream* aStream);
   // Initialize the clock with the current AudioStream. Need to be called
   // before querying the clock. Called on the audio thread.
   void Init();
   // Update the number of samples that has been written in the audio backend.
   // Called on the state machine thread.
   void UpdateFrameHistory(uint32_t aServiced, uint32_t aUnderrun);
-  // Get the read position of the stream, in microseconds.
-  // Called on the state machine thead.
-  // Assumes the AudioStream lock is held and thus calls Unlocked versions
-  // of AudioStream funcs.
-  int64_t GetPositionUnlocked() const;
 
   /**
    * @param frames The playback position in frames of the audio engine.
    * @return The playback position in frames of the stream,
    *         adjusted by playback rate changes and underrun frames.
    */
   int64_t GetPositionInFrames(int64_t frames) const;