Bug 1261627 - Unbreak --disable-webrtc builds. r=cpearce
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -615,17 +615,19 @@ AudioCallbackDriver::Init()
input = output;
input.channels = mInputChannels; // change to support optional stereo capture
cubeb_stream* stream = nullptr;
CubebUtils::AudioDeviceID input_id = nullptr, output_id = nullptr;
// We have to translate the deviceID values to cubeb devid's since those can be
// freed whenever enumerate is called.
{
+#ifdef MOZ_WEBRTC
StaticMutexAutoLock lock(AudioInputCubeb::Mutex());
+#endif
if ((!mGraphImpl->mInputWanted
#ifdef MOZ_WEBRTC
|| AudioInputCubeb::GetDeviceID(mGraphImpl->mInputDeviceID, input_id)
#endif
) &&
(mGraphImpl->mOutputDeviceID == -1 // pass nullptr for ID for default output
#ifdef MOZ_WEBRTC
// XXX we should figure out how we would use a deviceID for output without webrtc.
@@ -640,17 +642,19 @@ AudioCallbackDriver::Init()
"AudioCallbackDriver",
input_id,
mGraphImpl->mInputWanted ? &input : nullptr,
output_id,
mGraphImpl->mOutputWanted ? &output : nullptr, latency,
DataCallback_s, StateCallback_s, this) == CUBEB_OK) {
mAudioStream.own(stream);
} else {
+#ifdef MOZ_WEBRTC
StaticMutexAutoUnlock unlock(AudioInputCubeb::Mutex());
+#endif
NS_WARNING("Could not create a cubeb stream for MediaStreamGraph, falling back to a SystemClockDriver");
// Fall back to a driver using a normal thread.
MonitorAutoLock lock(GraphImpl()->GetMonitor());
SetNextDriver(new SystemClockDriver(GraphImpl()));
NextDriver()->SetGraphTime(this, mIterationStart, mIterationEnd);
mGraphImpl->SetCurrentDriver(NextDriver());
NextDriver()->Start();
return;