--- 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()) {