diff options
author | Paul Adenot <[email protected]> | 2023-11-13 13:56:22 +0100 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2024-04-16 16:30:46 +0200 |
commit | f42ca23add544f5b9a3acb1dfcd7955a4756f4d8 (patch) | |
tree | 5a9369eafb443c5de45675ca0e6a02c1e1bb662f | |
parent | 67db4cbc18581c8a6d8ea935af9854ed9729e7a7 (diff) | |
download | cubeb-f42ca23add544f5b9a3acb1dfcd7955a4756f4d8.tar.gz cubeb-f42ca23add544f5b9a3acb1dfcd7955a4756f4d8.zip |
Log a message when waiting for AAUDIO_STREAM_STATE_STOP when shutting down a stream in error fails
-rw-r--r-- | src/cubeb_aaudio.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/cubeb_aaudio.cpp b/src/cubeb_aaudio.cpp index f6ed5c6..1065d49 100644 --- a/src/cubeb_aaudio.cpp +++ b/src/cubeb_aaudio.cpp @@ -244,13 +244,24 @@ shutdown_with_error(cubeb_stream * stm) } int64_t poll_frequency_ns = NS_PER_S * stm->out_frame_size / stm->sample_rate; + int rv; if (stm->istream) { - wait_for_state_change(stm->istream, AAUDIO_STREAM_STATE_STOPPED, - poll_frequency_ns); + rv = wait_for_state_change(stm->istream, AAUDIO_STREAM_STATE_STOPPED, + poll_frequency_ns); + if (rv != CUBEB_OK) { + LOG("Failure when waiting for stream change on the input side when " + "shutting down in error"); + // Not much we can do, carry on + } } if (stm->ostream) { - wait_for_state_change(stm->ostream, AAUDIO_STREAM_STATE_STOPPED, - poll_frequency_ns); + rv = wait_for_state_change(stm->ostream, AAUDIO_STREAM_STATE_STOPPED, + poll_frequency_ns); + if (rv != CUBEB_OK) { + LOG("Failure when waiting for stream change on the output side when " + "shutting down in error"); + // Not much we can do, carry on + } } assert(!stm->in_data_callback.load()); |