summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorKarl Tomlinson <karlt+@karlt.net>2018-02-07 20:16:01 +1300
committerwolfbeast <mcwerewolf@gmail.com>2018-03-16 10:28:56 +0100
commitcca4af6c44be270ef964901b1d7c167654e4cf31 (patch)
tree1796161a723a9677710b626c6424744cb1ff96ba /dom
parent29371d13cad2d6159d9d78a02a30d3544a50954d (diff)
downloadaura-central-cca4af6c44be270ef964901b1d7c167654e4cf31.tar.gz
Bug 1426603 - Fallback from audio callback to system clock driver on error only once. r=padenot, a=RyanVM
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
Diffstat (limited to 'dom')
-rw-r--r--dom/media/GraphDriver.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp
index 9b74bd58c..40e3b72cf 100644
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -1055,6 +1055,7 @@ AudioCallbackDriver::StateCallback(cubeb_state aState)
{
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver State: %d", aState));
if (aState == CUBEB_STATE_ERROR && mShouldFallbackIfError) {
+ mShouldFallbackIfError = false;
MonitorAutoLock lock(GraphImpl()->GetMonitor());
// Fall back to a driver using a normal thread. If needed,
// the graph will try to re-open an audio stream later.