Bug 1277175 - Remove AudioStream::IsPaused(). r=kinetik.
authorJW Wang <jwwang@mozilla.com>
Tue, 31 May 2016 15:59:20 +0800
changeset 341135 71581f487d7c7c971771e1868b129353046b39bb
parent 341134 479829a9d62042f3f77858ac3ff404767a94c681
child 341136 db987382c68e2efebd8dff2a576fce0a3e70af8e
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1277175
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1277175 - Remove AudioStream::IsPaused(). r=kinetik. MozReview-Commit-ID: K2CHJ0E90MW
dom/media/AudioStream.cpp
dom/media/AudioStream.h
dom/media/mediasink/DecodedAudioDataSink.cpp
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -495,23 +495,16 @@ AudioStream::GetPositionInFramesUnlocked
   uint64_t position = 0;
   if (InvokeCubeb(cubeb_stream_get_position, &position) != CUBEB_OK) {
     return -1;
   }
   return std::min<uint64_t>(position, INT64_MAX);
 }
 
 bool
-AudioStream::IsPaused()
-{
-  MonitorAutoLock mon(mMonitor);
-  return mState == STOPPED;
-}
-
-bool
 AudioStream::IsValidAudioFormat(Chunk* aChunk)
 {
   if (aChunk->Rate() != mInRate) {
     LOGW("mismatched sample %u, mInRate=%u", aChunk->Rate(), mInRate);
     return false;
   }
 
   if (aChunk->Channels() > 8) {
--- a/dom/media/AudioStream.h
+++ b/dom/media/AudioStream.h
@@ -206,19 +206,16 @@ public:
   // Return the position in microseconds of the audio frame being played by
   // the audio hardware, compensated for playback rate change. Thread-safe.
   int64_t GetPosition();
 
   // Return the position, measured in audio frames played since the stream
   // was opened, of the audio hardware.  Thread-safe.
   int64_t GetPositionInFrames();
 
-  // Returns true when the audio stream is paused.
-  bool IsPaused();
-
   static uint32_t GetPreferredRate()
   {
     CubebUtils::InitPreferredSampleRate();
     return CubebUtils::PreferredSampleRate();
   }
   uint32_t GetRate() { return mOutRate; }
   uint32_t GetChannels() { return mChannels; }
   uint32_t GetOutChannels() { return mOutChannels; }
--- a/dom/media/mediasink/DecodedAudioDataSink.cpp
+++ b/dom/media/mediasink/DecodedAudioDataSink.cpp
@@ -178,19 +178,19 @@ DecodedAudioDataSink::SetPreservesPitch(
 
 void
 DecodedAudioDataSink::SetPlaying(bool aPlaying)
 {
   if (!mAudioStream || mPlaying == aPlaying || mPlaybackComplete) {
     return;
   }
   // pause/resume AudioStream as necessary.
-  if (!aPlaying && !mAudioStream->IsPaused()) {
+  if (!aPlaying) {
     mAudioStream->Pause();
-  } else if (aPlaying && mAudioStream->IsPaused()) {
+  } else if (aPlaying) {
     mAudioStream->Resume();
   }
   mPlaying = aPlaying;
 }
 
 nsresult
 DecodedAudioDataSink::InitializeAudioStream(const PlaybackParams& aParams)
 {