Skip to content

Commit 5b9763b

Browse files
committed
coreaudio: prevent null buffer by forcing min latency
1 parent 05f393c commit 5b9763b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

audio/drivers/coreaudio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ static void *coreaudio_init(const char *device,
285285
if (AudioUnitInitialize(dev->dev) != noErr)
286286
goto error;
287287

288+
/* Enforce minimum latency to prevent buffer issues */
289+
if (latency < 8)
290+
latency = 8;
291+
288292
fifo_size = (latency * (*new_rate)) / 1000;
289293
fifo_size *= 2 * sizeof(float);
290294
dev->buffer_size = fifo_size;

0 commit comments

Comments
 (0)