summaryrefslogtreecommitdiff
path: root/dom/media
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
commit338c6a43235768f1a0e73f268ee96d74eafe8f15 (patch)
tree1796161a723a9677710b626c6424744cb1ff96ba /dom/media
parent71429dc7ecc496c5924c770746e8c28449ecb7a2 (diff)
downloaduxp-338c6a43235768f1a0e73f268ee96d74eafe8f15.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/media')
-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 9b74bd58c9..40e3b72cfd 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.