From 980ef822163c5b7b32f561c28724624dfce6105d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 8 Mar 2021 17:42:42 +0100 Subject: [PATCH] output/wasapi: move SetEventHandle() call to thread constructor --- src/output/plugins/wasapi/WasapiOutputPlugin.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx index 3dfdd61fc..afe1c3e3c 100644 --- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx +++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx @@ -187,6 +187,7 @@ public: buffer_size_in_frames(_buffer_size_in_frames), is_exclusive(_is_exclusive), spsc_buffer(_buffer_size_in_frames * 4 * _frame_size) { + SetEventHandle(*client, event.handle()); } void Finish() noexcept { return SetStatus(Status::FINISH); } @@ -545,8 +546,6 @@ WasapiOutput::DoOpen(AudioFormat &audio_format) thread.emplace(client.get(), std::move(render_client), FrameSize(), buffer_size_in_frames, is_exclusive); - SetEventHandle(*client, thread->event.handle()); - thread->Start(); }