Bug 1261627 - Unbreak --disable-webrtc builds. r=cpearce
authorMats Palmgren <mats@mozilla.com>
Sat, 02 Apr 2016 12:04:00 -0400
changeset 291520 57cc6679cc66
parent 291519 b0ebc66fa9bb
child 291521 cfd51e67b26e
child 291524 0a0465d2c85b
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1261627
milestone48.0a1
Bug 1261627 - Unbreak --disable-webrtc builds. r=cpearce
dom/media/GraphDriver.cpp
--- 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;