Bug 1050947 - AudioStream::Pause() should do nothing when |mState| is ERRORED. r=kinetik, a=sledru
authorJW Wang <jwwang@mozilla.com>
Fri, 22 Aug 2014 02:36:00 -0400
changeset 217725 0756d338e9861c8d712057a790c721c6036ba410
parent 217724 26551f9f6ca18fe6c173d18bd3ba5efcf8fe87c6
child 217726 527cd5e7a209325b68c28e51c0978faad0ec60b2
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs1050947
milestone33.0a2
Bug 1050947 - AudioStream::Pause() should do nothing when |mState| is ERRORED. r=kinetik, a=sledru
content/media/AudioStream.cpp
--- a/content/media/AudioStream.cpp
+++ b/content/media/AudioStream.cpp
@@ -809,16 +809,21 @@ AudioStream::StartUnlocked()
     LOG(("AudioStream: started %p, state %s", this, mState == STARTED ? "STARTED" : "ERRORED"));
   }
 }
 
 void
 AudioStream::Pause()
 {
   MonitorAutoLock mon(mMonitor);
+
+  if (mState == ERRORED) {
+    return;
+  }
+
   if (!mCubebStream || (mState != STARTED && mState != RUNNING)) {
     mNeedsStart = false;
     mState = STOPPED; // which also tells async OpenCubeb not to start, just init
     return;
   }
 
   int r;
   {