mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
coreaudio: Add a note about why this uses 3 buffers instead of 2.
This commit is contained in:
parent
c0a9d220b9
commit
071bebf235
1 changed files with 4 additions and 0 deletions
|
|
@ -817,6 +817,10 @@ static bool PrepareAudioQueue(SDL_AudioDevice *device)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// we use THREE audio buffers by default, unlike most things that would
|
||||||
|
// choose two alternating buffers, because it helps with issues on
|
||||||
|
// Bluetooth headsets when recording and playing at the same time.
|
||||||
|
// See conversation in #8192 for details.
|
||||||
int numAudioBuffers = 3;
|
int numAudioBuffers = 3;
|
||||||
const double msecs = (device->sample_frames / ((double)device->spec.freq)) * 1000.0;
|
const double msecs = (device->sample_frames / ((double)device->spec.freq)) * 1000.0;
|
||||||
if (msecs < MINIMUM_AUDIO_BUFFER_TIME_MS) { // use more buffers if we have a VERY small sample set.
|
if (msecs < MINIMUM_AUDIO_BUFFER_TIME_MS) { // use more buffers if we have a VERY small sample set.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue