output/wasapi: Finish() calls Join()

This commit is contained in:
Max Kellermann
2021-03-08 22:28:17 +01:00
parent 29346dc9c5
commit 01d3c2705e

View File

@@ -189,7 +189,11 @@ public:
SetEventHandle(client, event.handle()); SetEventHandle(client, event.handle());
} }
void Finish() noexcept { return SetStatus(Status::FINISH); } void Finish() noexcept {
SetStatus(Status::FINISH);
Join();
}
void Play() noexcept { return SetStatus(Status::PLAY); } void Play() noexcept { return SetStatus(Status::PLAY); }
void Pause() noexcept { return SetStatus(Status::PAUSE); } void Pause() noexcept { return SetStatus(Status::PAUSE); }
void WaitDataPoped() noexcept { data_poped.Wait(); } void WaitDataPoped() noexcept { data_poped.Wait(); }
@@ -551,7 +555,6 @@ WasapiOutput::Close() noexcept
} }
is_started = false; is_started = false;
thread->Finish(); thread->Finish();
thread->Join();
com_worker->Async([&]() { com_worker->Async([&]() {
thread.reset(); thread.reset();
client.reset(); client.reset();