coreaudio: dynamically allocate AudioQueueBuffers.

We need more than two buffers to flip between if they are small, or CoreAudio
won't make any sound; apparently it needs X milliseconds of audio queued when
it needs to play more or it drops any queued buffers. We are currently
guessing 50 milliseconds as a minimum, but there's probably a more proper
way to get the minimum time period from the system.

Fixes Bugzilla #3656.
This commit is contained in:
Ryan C. Gordon
2017-05-24 00:12:22 -04:00
parent 088f57a62a
commit 793c788b1c
2 changed files with 23 additions and 3 deletions

View File

@@ -47,7 +47,8 @@ struct SDL_PrivateAudioData
{
SDL_Thread *thread;
AudioQueueRef audioQueue;
AudioQueueBufferRef audioBuffer[2];
int numAudioBuffers;
AudioQueueBufferRef *audioBuffer;
void *buffer;
UInt32 bufferOffset;
UInt32 bufferSize;