Bug 1277188. Part 3 - remove AudioClock::GetPositionUnlocked(). r=kinetik.
MozReview-Commit-ID: 9g3wqI63OsR
--- 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;