Commit 8024f7e8 authored by Max Kellermann's avatar Max Kellermann

output/wasapi: move the thread->Play() call right before the consumed_size check

Fixes a bogus assertion failure (which can now be removed).
parent 14f01340
...@@ -633,8 +633,13 @@ WasapiOutput::Play(const void *chunk, size_t size) ...@@ -633,8 +633,13 @@ WasapiOutput::Play(const void *chunk, size_t size)
do { do {
const size_t consumed_size = thread->spsc_buffer.push( const size_t consumed_size = thread->spsc_buffer.push(
static_cast<const BYTE *>(input.data), input.size); static_cast<const BYTE *>(input.data), input.size);
if (!is_started) {
is_started = true;
thread->Play();
}
if (consumed_size == 0) { if (consumed_size == 0) {
assert(is_started);
thread->Wait(); thread->Wait();
thread->CheckException(); thread->CheckException();
if (!not_interrupted.test_and_set()) { if (!not_interrupted.test_and_set()) {
...@@ -643,11 +648,6 @@ WasapiOutput::Play(const void *chunk, size_t size) ...@@ -643,11 +648,6 @@ WasapiOutput::Play(const void *chunk, size_t size)
continue; continue;
} }
if (!is_started) {
is_started = true;
thread->Play();
}
thread->CheckException(); thread->CheckException();
if (pcm_export) { if (pcm_export) {
......
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