From 3fd35f6bb00d108ec2f0d292224466d31e7caf09 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 24 May 2017 01:28:03 -0400 Subject: [PATCH] coreaudio: looks like we need more like a 10ms buffer minimum, not 50ms. --- src/audio/coreaudio/SDL_coreaudio.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m index 2b9d6de66..3cafe3a18 100644 --- a/src/audio/coreaudio/SDL_coreaudio.m +++ b/src/audio/coreaudio/SDL_coreaudio.m @@ -665,11 +665,11 @@ prepare_audioqueue(_THIS) } /* Make sure we can feed the device at least 50 milliseconds at a time. */ - const double msecs = (this->spec.size / ((double) this->spec.freq)) * 1000.0; - if (msecs >= 50.0) { + const double msecs = (this->spec.samples / ((double) this->spec.freq)) * 1000.0; + if (msecs >= 10.0) { this->hidden->numAudioBuffers = 2; } else { - this->hidden->numAudioBuffers = (int) (SDL_ceil(50.0 / msecs) * 2); + this->hidden->numAudioBuffers = (int) (SDL_ceil(10.0 / msecs) * 2); } this->hidden->audioBuffer = SDL_calloc(1, sizeof (AudioQueueBufferRef) * this->hidden->numAudioBuffers);