summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-03-10 20:03:13 +0100
committerMax Kellermann <max@musicpd.org>2021-03-10 20:07:22 +0100
commitfe7c5a420821811f51163b6a303e996130afea6c (patch)
treefbe25896b51e5c8bf7741ab554b7c1dddb03d7ef /src/output
parent8024f7e84ddbeaae1cee3179174886b8083d629f (diff)
output/wasapi: initialize is_started in Open()
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/wasapi/WasapiOutputPlugin.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
index db61fff3f..f415c51e0 100644
--- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
@@ -234,7 +234,11 @@ class WasapiOutput final : public AudioOutput {
const bool dop_setting;
#endif
- bool is_started = false;
+ /**
+ * Only valid if the output is open.
+ */
+ bool is_started;
+
std::atomic_flag not_interrupted = true;
const std::string device_config;
@@ -583,6 +587,8 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
watermark = buffer_size_in_frames * 3 * FrameSize();
thread.emplace(*client, std::move(render_client), FrameSize(),
buffer_size_in_frames, is_exclusive);
+
+ is_started = false;
}
void
@@ -596,7 +602,6 @@ WasapiOutput::Close() noexcept
FormatError(std::current_exception(),
"exception while stopping");
}
- is_started = false;
thread->Finish();
com_worker->Async([&]() {
thread.reset();