summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-03-10 20:06:59 +0100
committerMax Kellermann <max@musicpd.org>2021-03-10 20:07:19 +0100
commit8024f7e84ddbeaae1cee3179174886b8083d629f (patch)
treeed8e77cab38385b49d1bbe1ce22b8c241cbfd0d0 /src/output
parent14f0134097664a8bf6ba9ee36863378207127eba (diff)
output/wasapi: move the thread->Play() call right before the consumed_size check
Fixes a bogus assertion failure (which can now be removed).
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/wasapi/WasapiOutputPlugin.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
index a1c3d69ee..db61fff3f 100644
--- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
@@ -633,8 +633,13 @@ WasapiOutput::Play(const void *chunk, size_t size)
do {
const size_t consumed_size = thread->spsc_buffer.push(
static_cast<const BYTE *>(input.data), input.size);
+
+ if (!is_started) {
+ is_started = true;
+ thread->Play();
+ }
+
if (consumed_size == 0) {
- assert(is_started);
thread->Wait();
thread->CheckException();
if (!not_interrupted.test_and_set()) {
@@ -643,11 +648,6 @@ WasapiOutput::Play(const void *chunk, size_t size)
continue;
}
- if (!is_started) {
- is_started = true;
- thread->Play();
- }
-
thread->CheckException();
if (pcm_export) {