Commit fe5b81e1 authored by Max Kellermann's avatar Max Kellermann

output/osx: check `started` in Close() and Cancel()

parent f032925c
...@@ -667,6 +667,7 @@ OSXOutput::Disable() noexcept ...@@ -667,6 +667,7 @@ OSXOutput::Disable() noexcept
void void
OSXOutput::Close() noexcept OSXOutput::Close() noexcept
{ {
if (started)
AudioOutputUnitStop(au); AudioOutputUnitStop(au);
AudioUnitUninitialize(au); AudioUnitUninitialize(au);
delete ring_buffer; delete ring_buffer;
...@@ -821,7 +822,11 @@ bool OSXOutput::Pause() ...@@ -821,7 +822,11 @@ bool OSXOutput::Pause()
void void
OSXOutput::Cancel() noexcept OSXOutput::Cancel() noexcept
{ {
if (started) {
AudioOutputUnitStop(au); AudioOutputUnitStop(au);
started = false;
}
ring_buffer->reset(); ring_buffer->reset();
#ifdef ENABLE_DSD #ifdef ENABLE_DSD
pcm_export->Reset(); pcm_export->Reset();
......
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