[Commits] SDL: coreaudio: looks like we need more like a 10ms buffer minim...

libsdl.org revision control commits-owner at libsdl.org
Tue May 23 22:28:07 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/0b4a3c824d38
changeset: 11023:0b4a3c824d38
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Wed May 24 01:28:03 2017 -0400
description:
coreaudio: looks like we need more like a 10ms buffer minimum, not 50ms.

diffstat:

 src/audio/coreaudio/SDL_coreaudio.m |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (18 lines):

diff -r ad26a063ffff -r 0b4a3c824d38 src/audio/coreaudio/SDL_coreaudio.m
--- a/src/audio/coreaudio/SDL_coreaudio.m	Wed May 24 00:12:22 2017 -0400
+++ b/src/audio/coreaudio/SDL_coreaudio.m	Wed May 24 01:28:03 2017 -0400
@@ -665,11 +665,11 @@
     }
 
     /* 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);


More information about the commits mailing list