imported patch switching_update draft
authorRandell Jesup <rjesup@jesup.org>
Tue, 12 Jan 2016 18:14:13 -0500
changeset 321199 d744ba5e39829d3b192193a34c3c20c6148325b7
parent 321198 f213dca2178831c9493ad64a774dc7d3a000090c
child 321200 5d9121844bc95d82784ad36110ffdcf62b9938ca
push id9349
push userrjesup@wgate.com
push dateWed, 13 Jan 2016 06:48:48 +0000
milestone46.0a1
imported patch switching_update
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1001,22 +1001,23 @@ MediaStreamGraphImpl::CloseAudioInputImp
   MonitorAutoLock mon(mMonitor);
   if (mLifecycleState == LIFECYCLE_RUNNING) {
     GraphDriver* driver;
     if (audioTrackPresent) {
       // We still have audio output
       STREAM_LOG(LogLevel::Debug, ("CloseInput: output present (AudioCallback)"));
 
       driver = new AudioCallbackDriver(this);
-    } else {
+      CurrentDriver()->SwitchAtNextIteration(driver);
+    } else if (CurrentDriver()->AsAudioCallbackDriver()) {
       STREAM_LOG(LogLevel::Debug, ("CloseInput: no output present (SystemClockCallback)"));
 
       driver = new SystemClockDriver(this);
-    }
-    CurrentDriver()->SwitchAtNextIteration(driver);
+      CurrentDriver()->SwitchAtNextIteration(driver);
+    } // else SystemClockDriver->SystemClockDriver, no switch
   }
 }
 
 void
 MediaStreamGraphImpl::CloseAudioInput(AudioDataListener *aListener)
 {
   // So, so, so annoying.  Can't AppendMessage except on Mainthread
   if (!NS_IsMainThread()) {