aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2022-04-12 12:56:37 +1200
committerPaul Adenot <[email protected]>2022-04-13 16:57:00 +0200
commit62d4926af198b7d638ec3be20aff7d319a0b03ba (patch)
tree9bd27b77ce1adf971bdec79337ba7950480fafa0
parente91fa6b3f25963533e1b7919b988bd20a9422118 (diff)
downloadcubeb-62d4926af198b7d638ec3be20aff7d319a0b03ba.tar.gz
cubeb-62d4926af198b7d638ec3be20aff7d319a0b03ba.zip
wasapi: Stop audio clients when render thread exits.
-rw-r--r--src/cubeb_wasapi.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp
index 7fe0778..ad3a110 100644
--- a/src/cubeb_wasapi.cpp
+++ b/src/cubeb_wasapi.cpp
@@ -1469,6 +1469,15 @@ static unsigned int __stdcall wasapi_stream_render_loop(LPVOID stream)
}
}
+ // Stop audio clients since this thread will no longer service
+ // the events.
+ if (stm->output_client) {
+ stm->output_client->Stop();
+ }
+ if (stm->input_client) {
+ stm->input_client->Stop();
+ }
+
if (mmcss_handle) {
AvRevertMmThreadCharacteristics(mmcss_handle);
}