summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-07-02 15:09:18 +0200
committerMax Kellermann <max@musicpd.org>2020-07-02 15:10:03 +0200
commit8125a5dddb250b9a9ceb4917b31a33c5813d392e (patch)
tree2f0ca6830f5124f841e06b6e22cb6a880dd83a73 /src
parent154170e4755fc53c56652a32b13d82db21ff7c2d (diff)
output/osx: don't uninitialize AudioUnit if restart fails
This shall be done by Close(), which will be called automatically after an error.
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/OSXOutputPlugin.cxx5
1 files 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