diff options
author | Matthew Gregan <[email protected]> | 2022-12-07 18:20:55 +1300 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2022-12-08 09:24:26 +1300 |
commit | 8d7365a9d5e057af79f9a64f113e9d7cd9e63709 (patch) | |
tree | 260c5b48b596b9d78550b82995b8dc42b5225cbf | |
parent | cfc5692bf7c556d5c9f66f782fa15d1e8b80e761 (diff) | |
download | cubeb-8d7365a9d5e057af79f9a64f113e9d7cd9e63709.tar.gz cubeb-8d7365a9d5e057af79f9a64f113e9d7cd9e63709.zip |
wasapi: Release WASAPI resources in inverse order to acquisition.
This shouldn't have any behavioural effect as the WASAPI resources are
reference counted internally.
-rw-r--r-- | src/cubeb_wasapi.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp index 7767b3a..6f8d27b 100644 --- a/src/cubeb_wasapi.cpp +++ b/src/cubeb_wasapi.cpp @@ -2813,20 +2813,18 @@ close_wasapi_stream(cubeb_stream * stm) stm->stream_reset_lock.assert_current_thread_owns(); - stm->output_client = nullptr; +#ifdef CUBEB_WASAPI_USE_IAUDIOSTREAMVOLUME + stm->audio_stream_volume = nullptr; +#endif + stm->audio_clock = nullptr; stm->render_client = nullptr; + stm->output_client = nullptr; + stm->output_device = nullptr; - stm->input_client = nullptr; stm->capture_client = nullptr; - - stm->output_device = nullptr; + stm->input_client = nullptr; stm->input_device = nullptr; -#ifdef CUBEB_WASAPI_USE_IAUDIOSTREAMVOLUME - stm->audio_stream_volume = nullptr; -#endif - - stm->audio_clock = nullptr; stm->total_frames_written += static_cast<UINT64>( round(stm->frames_written * stream_to_mix_samplerate_ratio(stm->output_stream_params, |