diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index a041fcbcd..0a51af7a5 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -769,14 +769,6 @@ OSXOutput::Play(const void *chunk, size_t size) pause = false; - if (!started) { - OSStatus status = AudioOutputUnitStart(au); - if (status != noErr) - throw std::runtime_error("Unable to restart audio output after pause"); - - started = true; - } - ConstBuffer input((const uint8_t *)chunk, size); #ifdef ENABLE_DSD @@ -795,6 +787,14 @@ OSXOutput::Play(const void *chunk, size_t size) size_t bytes_written = ring_buffer->push(input.data, input.size); + if (!started) { + OSStatus status = AudioOutputUnitStart(au); + if (status != noErr) + throw std::runtime_error("Unable to restart audio output after pause"); + + started = true; + } + #ifdef ENABLE_DSD if (dop_enabled) bytes_written = pcm_export->CalcSourceSize(bytes_written);