Commit fe7c5a42 authored by Max Kellermann's avatar Max Kellermann

output/wasapi: initialize is_started in Open()

parent 8024f7e8
...@@ -234,7 +234,11 @@ class WasapiOutput final : public AudioOutput { ...@@ -234,7 +234,11 @@ class WasapiOutput final : public AudioOutput {
const bool dop_setting; const bool dop_setting;
#endif #endif
bool is_started = false; /**
* Only valid if the output is open.
*/
bool is_started;
std::atomic_flag not_interrupted = true; std::atomic_flag not_interrupted = true;
const std::string device_config; const std::string device_config;
...@@ -583,6 +587,8 @@ WasapiOutput::DoOpen(AudioFormat &audio_format) ...@@ -583,6 +587,8 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
watermark = buffer_size_in_frames * 3 * FrameSize(); watermark = buffer_size_in_frames * 3 * FrameSize();
thread.emplace(*client, std::move(render_client), FrameSize(), thread.emplace(*client, std::move(render_client), FrameSize(),
buffer_size_in_frames, is_exclusive); buffer_size_in_frames, is_exclusive);
is_started = false;
} }
void void
...@@ -596,7 +602,6 @@ WasapiOutput::Close() noexcept ...@@ -596,7 +602,6 @@ WasapiOutput::Close() noexcept
FormatError(std::current_exception(), FormatError(std::current_exception(),
"exception while stopping"); "exception while stopping");
} }
is_started = false;
thread->Finish(); thread->Finish();
com_worker->Async([&]() { com_worker->Async([&]() {
thread.reset(); thread.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment