Bug Fix: Fix inserting empty chunks on track ends

This code did not check the number of samples in a packet before adding
it to the output buffer, which apparently had the potential to cause the
output code to emit up to 512 samples of silence between tracks. This,
as one can guess, is a bad thing, and causes noticeable gapping between
tracks.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-03-26 19:07:36 -07:00
parent 576b199382
commit 954cfa02d9

View file

@ -625,9 +625,7 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
AudioChunk *chunk = [self renderInput:512];
size_t frameCount = 0;
if(chunk) {
frameCount = [chunk frameCount];
if(chunk && (frameCount = [chunk frameCount])) {
[outputLock lock];
[outputBuffer addChunk:chunk];
[outputLock unlock];