Bug 1277188. Part 3 - remove AudioClock::GetPositionUnlocked(). r=kinetik.
authorJW Wang <jwwang@mozilla.com>
Wed, 01 Jun 2016 16:30:54 +0800
changeset 324785 76384d9681f05f0ecbf441da86f488263b76523f
parent 324784 79f157a49a16cdb1b00716146b3537f7ce2b9797
child 324786 6f33d9a58e7216799c5f98238b7a56620083a5fe
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;