From c7c3c82c18170fabab515abef91abf0b6f799356 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 25 Jan 2022 21:55:08 -0800 Subject: [PATCH] Core Audio output: Change end of file timing Reduce the timing at which an end of file notification is sent to the main thread from 16384 bytes to 8192 bytes. This may help with playback of a lot of really small files, and skipping tracks. Signed-off-by: Christopher Snowhill --- Audio/Output/OutputCoreAudio.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Audio/Output/OutputCoreAudio.m b/Audio/Output/OutputCoreAudio.m index 4625f1847..d1d89549e 100644 --- a/Audio/Output/OutputCoreAudio.m +++ b/Audio/Output/OutputCoreAudio.m @@ -277,10 +277,10 @@ default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const bytesBuffered += atomic_load_explicit(&bytesRendered, memory_order_relaxed); if ([outputController chainQueueHasTracks]) { - if (bytesBuffered < CHUNK_SIZE) + if (bytesBuffered < CHUNK_SIZE / 2) bytesBuffered = 0; else - bytesBuffered -= CHUNK_SIZE; + bytesBuffered -= CHUNK_SIZE / 2; } else { stopNext = YES;