bug 1436267 fallback from audio callback to system clock driver on error only once r=padenot a=ritu
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 07 Feb 2018 20:16:01 +1300
changeset 454850 2e8b4957bf5f477c66ef4da8390426d261b1daf2
parent 454849 1b25b61d773b47ad1ca081c2c88b0ae9286a38d3
child 454851 ff9753468f8c52fb2c29ab76bc888675335bee26
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, ritu
bugs1436267
milestone59.0
bug 1436267 fallback from audio callback to system clock driver on error only once r=padenot a=ritu Usually, mShouldFallbackIfError has been reset to false in DataCallback() before Stop() is called. However, if fallback to a system clock driver due to cubeb error had already occurred, then mShouldFallbackIfError would not have been reset, and Stop() is still called. With mShouldFallbackIfError still true, a cubeb error in stop would have created another fallback thread. I expect that resetting mShouldFallbackIfError in Stop() would also be an effective alternative solution, but resetting on StateCallback() happens earlier, which would be an advantage if any additional errors could possibly be reported to StateCallback(). MozReview-Commit-ID: E9j7PQmS3O4
dom/media/GraphDriver.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -1034,16 +1034,17 @@ AudioCallbackDriver::DataCallback(const 
 }
 
 void
 AudioCallbackDriver::StateCallback(cubeb_state aState)
 {
   LOG(LogLevel::Debug, ("AudioCallbackDriver State: %d", aState));
 
   if (aState == CUBEB_STATE_ERROR && mShouldFallbackIfError) {
+    mShouldFallbackIfError = false;
     MonitorAutoLock lock(GraphImpl()->GetMonitor());
     RemoveCallback();
     FallbackToSystemClockDriver();
   }
 }
 
 void
 AudioCallbackDriver::MixerCallback(AudioDataValue* aMixedBuffer,