mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
coreaudio: looks like we need more like a 10ms buffer minimum, not 50ms.
This commit is contained in:
parent
793c788b1c
commit
3fd35f6bb0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user