Browse Source

coreaudio: Use three buffers for the audioqueue, not two.

This doesn't affect latency much, but it makes the system usable if the system
drops you down from the bluetooth a2dp profile (headphones) to the handsfree
(I think...?) profile because the bluetooth audio device is also recording,
which would be extremely common in a VoIP app, but also if you're talking
in a different app while also playing audio.

Fixes #8192.
Ryan C. Gordon 6 tháng trước cách đây
mục cha
commit
b6d0bc0431
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/audio/coreaudio/SDL_coreaudio.m

+ 1 - 1
src/audio/coreaudio/SDL_coreaudio.m

@@ -817,7 +817,7 @@ static bool PrepareAudioQueue(SDL_AudioDevice *device)
     }
     #endif
 
-    int numAudioBuffers = 2;
+    int numAudioBuffers = 3;
     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.
         numAudioBuffers = ((int)SDL_ceil(MINIMUM_AUDIO_BUFFER_TIME_MS / msecs) * 2);