diff options
-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()); |