Bug 1059899 - When cubeb_stream_init fails, fallback to using a SystemClockDriver. r=jesup, a=lmandel
authorPaul Adenot <paul@paul.cx>
Fri, 12 Sep 2014 13:22:55 +0200
changeset 224824 5896de36a201009c404c0f0107507471fa4e7ad7
parent 224823 ac61dfa6af71d8e3234246462bab370016160e78
child 224825 0b02790c64fce1b641f7b85e5e1141941de8baae
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lmandel
bugs1059899
milestone34.0a2
Bug 1059899 - When cubeb_stream_init fails, fallback to using a SystemClockDriver. r=jesup, a=lmandel
content/media/GraphDriver.cpp
--- a/content/media/GraphDriver.cpp
+++ b/content/media/GraphDriver.cpp
@@ -571,17 +571,23 @@ AudioCallbackDriver::Init()
   }
 
   cubeb_stream* stream;
   if (cubeb_stream_init(CubebUtils::GetCubebContext(), &stream,
                         "AudioCallbackDriver", params, latency,
                         DataCallback_s, StateCallback_s, this) == CUBEB_OK) {
     mAudioStream.own(stream);
   } else {
-    NS_WARNING("Could not create a cubeb stream for MediaStreamGraph.");
+    NS_WARNING("Could not create a cubeb stream for MediaStreamGraph, falling back to a SystemClockDriver");
+    // Fall back to a driver using a normal thread.
+    mNextDriver = new SystemClockDriver(GraphImpl());
+    mNextDriver->SetGraphTime(this, mIterationStart, mIterationEnd,
+                               mStateComputedTime, mNextStateComputedTime);
+    mGraphImpl->SetCurrentDriver(mNextDriver);
+    mNextDriver->Start();
     return;
   }
 
   cubeb_stream_register_device_changed_callback(mAudioStream,
                                                 AudioCallbackDriver::DeviceChangedCallback_s);
 
   StartStream();