bug 1436267 fallback from audio callback to system clock driver on error only once r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 07 Feb 2018 20:16:01 +1300
changeset 402823 c96fdc3e0d635b2036996f30ecf5d667d1d62027
parent 402822 8228ef851efd6377eaec64e995b69ca86e4ee3e9
child 402824 2f1f2a979ff1e5795854921e69b5bb0c07768739
push id33404
push usershindli@mozilla.com
push dateThu, 08 Feb 2018 10:03:18 +0000
treeherdermozilla-central@06b5d7476ebd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1436267
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1436267 fallback from audio callback to system clock driver on error only once r=padenot 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
@@ -1035,16 +1035,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,