output/wasapi: implement Cancel()
This commit is contained in:
parent
34d4d9157a
commit
5f656dffda
|
@ -258,6 +258,7 @@ public:
|
|||
std::chrono::steady_clock::duration Delay() const noexcept override;
|
||||
size_t Play(const void *chunk, size_t size) override;
|
||||
void Drain() override;
|
||||
void Cancel() noexcept override;
|
||||
bool Pause() override;
|
||||
void Interrupt() noexcept override;
|
||||
|
||||
|
@ -664,6 +665,14 @@ WasapiOutput::Drain()
|
|||
thread->CheckException();
|
||||
}
|
||||
|
||||
void
|
||||
WasapiOutput::Cancel() noexcept
|
||||
{
|
||||
assert(thread);
|
||||
|
||||
thread->spsc_buffer.consume_all([](auto &&) {});
|
||||
}
|
||||
|
||||
/// run inside COMWorkerThread
|
||||
void
|
||||
WasapiOutput::OpenDevice()
|
||||
|
|
Loading…
Reference in New Issue