From 8125a5dddb250b9a9ceb4917b31a33c5813d392e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Jul 2020 15:09:18 +0200 Subject: [PATCH] output/osx: don't uninitialize AudioUnit if restart fails This shall be done by Close(), which will be called automatically after an error. --- src/output/plugins/OSXOutputPlugin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index e87c5c3db..e7b677d04 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -763,10 +763,9 @@ OSXOutput::Play(const void *chunk, size_t size) assert(size > 0); if (pause) { OSStatus status = AudioOutputUnitStart(au); - if (status != 0) { - AudioUnitUninitialize(au); + if (status != noErr) throw std::runtime_error("Unable to restart audio output after pause"); - } + pause = false; } #ifdef ENABLE_DSD