Bug 1276840 - Remove AudioStream::RUNNING. r=kinetik.
authorJW Wang <jwwang@mozilla.com>
Tue, 31 May 2016 11:54:30 +0800
changeset 340871 d7246e5a52b1f3e6f5f3a51fce569dec1072fe63
parent 340870 fa2962ff448e58356955538a876787e411d7b18f
child 340872 a9db7e5634d7a6aa9e1c32f6722a010c27c1d55f
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
bugs1276840
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 1276840 - Remove AudioStream::RUNNING. r=kinetik. MozReview-Commit-ID: 3sCGYifUxJO
dom/media/AudioStream.cpp
dom/media/AudioStream.h
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -436,17 +436,17 @@ void
 AudioStream::Pause()
 {
   MonitorAutoLock mon(mMonitor);
 
   if (mState == ERRORED) {
     return;
   }
 
-  if (mState != STARTED && mState != RUNNING) {
+  if (mState != STARTED) {
     mState = STOPPED; // which also tells async OpenCubeb not to start, just init
     return;
   }
 
   int r = InvokeCubeb(cubeb_stream_stop);
   if (mState != ERRORED && r == CUBEB_OK) {
     mState = STOPPED;
   }
@@ -621,21 +621,16 @@ AudioStream::DataCallback(void* aBuffer,
     NS_WARNING("data callback fires before cubeb_stream_start() is called");
     mAudioClock.UpdateFrameHistory(0, aFrames);
     return writer.WriteZeros(aFrames);
   }
 
   // NOTE: wasapi (others?) can call us back *after* stop()/Shutdown() (mState == SHUTDOWN)
   // Bug 996162
 
-  // callback tells us cubeb succeeded initializing
-  if (mState == STARTED) {
-    mState = RUNNING;
-  }
-
   if (mInRate == mOutRate) {
     GetUnprocessed(writer);
   } else {
     GetTimeStretched(writer);
   }
 
   // Always send audible frames first, and silent frames later.
   // Otherwise it will break the assumption of FrameHistory.
--- a/dom/media/AudioStream.h
+++ b/dom/media/AudioStream.h
@@ -358,18 +358,17 @@ private:
   // Output file for dumping audio
   FILE* mDumpFile;
 
   // Owning reference to a cubeb_stream.
   UniquePtr<cubeb_stream, CubebDestroyPolicy> mCubebStream;
 
   enum StreamState {
     INITIALIZED, // Initialized, playback has not begun.
-    STARTED,     // cubeb started, but callbacks haven't started
-    RUNNING,     // DataCallbacks have started after STARTED, or after Resume().
+    STARTED,     // cubeb started.
     STOPPED,     // Stopped by a call to Pause().
     DRAINED,     // StateCallback has indicated that the drain is complete.
     ERRORED,     // Stream disabled due to an internal error.
     SHUTDOWN     // Shutdown has been called
   };
 
   StreamState mState;
   bool mIsFirst;