Bug 1404977 - Exit NotifyInputData early if there's no input listener. r?achronop
MozReview-Commit-ID: KMy01D2VjLi
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -971,16 +971,19 @@ MediaStreamGraphImpl::NotifyInputData(co
{
MonitorAutoLock lock(mMonitor);
// Either we have an audio input device, or we just removed the audio input
// this iteration, and we're switching back to an output-only driver next
// iteration.
MOZ_ASSERT(mInputDeviceID || CurrentDriver()->Switching());
}
#endif
+ if (!mInputDeviceID) {
+ return;
+ }
nsTArray<RefPtr<AudioDataListener>>* listeners = mInputDeviceUsers.GetValue(mInputDeviceID);
MOZ_ASSERT(listeners);
for (auto& listener : *listeners) {
listener->NotifyInputData(this, aBuffer, aFrames, aRate, aChannels);
}
}
void MediaStreamGraphImpl::DeviceChangedImpl()