aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2023-11-13 13:56:52 +0100
committerPaul Adenot <[email protected]>2024-04-16 16:30:46 +0200
commit529c3d26443003e474535766f7bb67ca4bb0edee (patch)
tree52e6baf95b8f537919182a41790791433edcac90
parentf42ca23add544f5b9a3acb1dfcd7955a4756f4d8 (diff)
downloadcubeb-529c3d26443003e474535766f7bb67ca4bb0edee.tar.gz
cubeb-529c3d26443003e474535766f7bb67ca4bb0edee.zip
Attempt to reinitialize the stream when the error callback is called with AAUDIO_ERROR_TIMEOUT
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 1065d49..cfae2d6 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;