From fe5b81e1805b15e14865124bcca9543f23f3f3f8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Jul 2020 15:13:05 +0200 Subject: [PATCH] output/osx: check `started` in Close() and Cancel() --- src/output/plugins/OSXOutputPlugin.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index 10cf419e9..6d5bb3a23 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -667,7 +667,8 @@ OSXOutput::Disable() noexcept void OSXOutput::Close() noexcept { - AudioOutputUnitStop(au); + if (started) + AudioOutputUnitStop(au); AudioUnitUninitialize(au); delete ring_buffer; } @@ -821,7 +822,11 @@ bool OSXOutput::Pause() void OSXOutput::Cancel() noexcept { - AudioOutputUnitStop(au); + if (started) { + AudioOutputUnitStop(au); + started = false; + } + ring_buffer->reset(); #ifdef ENABLE_DSD pcm_export->Reset();