aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2023-11-13 13:56:52 +0100
committerPaul Adenot <[email protected]>2023-11-13 13:58:56 +0100
commitbe56a7493b0bc3780ba34c2a8ad16b9e8b8e72bc (patch)
tree2a2c5ec58edc60a70da62cddb7c3da2e650c0c99
parent45423741c7525167ced22fcdc465cda19e8b4f3b (diff)
downloadcubeb-aaudio-timeout-restart.tar.gz
cubeb-aaudio-timeout-restart.zip
Attempt to reinitialize the stream when the error callback is called with AAUDIO_ERROR_TIMEOUTaaudio-timeout-restart
This can happen when the client side of the AAudio API fails to write all the data to the server side, after the user callback has returned. According to the reporter, this can be hit when a debugger is attached. This fixes #767.
-rw-r--r--src/cubeb_aaudio.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cubeb_aaudio.cpp b/src/cubeb_aaudio.cpp
index db417c0..a7472dd 100644
--- a/src/cubeb_aaudio.cpp
+++ b/src/cubeb_aaudio.cpp
@@ -931,7 +931,7 @@ aaudio_error_cb(AAudioStream * astream, void * user_data, aaudio_result_t error)
assert(stm->ostream == astream || stm->istream == astream);
// Device change -- reinitialize on the new default device.
- if (error == AAUDIO_ERROR_DISCONNECTED) {
+ if (error == AAUDIO_ERROR_DISCONNECTED || error == AAUDIO_ERROR_TIMEOUT) {
LOG("Audio device change, reinitializing stream");
reinitialize_stream(stm);
return;