diff options
author | Paul Adenot <[email protected]> | 2023-11-13 13:56:22 +0100 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2023-11-13 13:56:22 +0100 |
commit | 45423741c7525167ced22fcdc465cda19e8b4f3b (patch) | |
tree | 9d018f8a7fc1e195ddd263d975a3d977849f100e /src/cubeb_aaudio.cpp | |
parent | 30efcd1cdf8a794e918fe2c6e9b74c8ea8bbcdd6 (diff) | |
download | cubeb-45423741c7525167ced22fcdc465cda19e8b4f3b.tar.gz cubeb-45423741c7525167ced22fcdc465cda19e8b4f3b.zip |
Log a message when waiting for AAUDIO_STREAM_STATE_STOP when shutting down a stream in error fails
Diffstat (limited to 'src/cubeb_aaudio.cpp')
-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 f95f7f0..db417c0 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()); |