Commit daefc61a authored by Max Kellermann's avatar Max Kellermann

output/osx: postpone start until the end of Play()

Wait until there is data in the ring buffer.
parent 6fed6e50
......@@ -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<uint8_t> 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);
......
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