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

Fixes a bogus assertion failure (which can now be removed).
This commit is contained in:
Max Kellermann 2021-03-10 20:06:59 +01:00
parent 14f0134097
commit 8024f7e84d
1 changed files with 6 additions and 6 deletions

View File

@ -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) {