coreaudio: Use the standard SDL audio thread instead of spinning a new one.

Fixes corner cases, like the audio callback not firing if the device is
disconnected, etc.
This commit is contained in:
Ryan C. Gordon
2018-04-16 02:11:09 -04:00
parent 2df59062dc
commit dc8b55e50b
3 changed files with 100 additions and 130 deletions

View File

@@ -45,16 +45,14 @@
struct SDL_PrivateAudioData
{
SDL_Thread *thread;
AudioQueueRef audioQueue;
int numAudioBuffers;
AudioQueueBufferRef *audioBuffer;
void *buffer;
UInt32 bufferOffset;
UInt32 bufferSize;
AudioStreamBasicDescription strdesc;
SDL_sem *ready_semaphore;
char *thread_error;
SDL_atomic_t shutdown;
SDL_bool refill;
SDL_AudioStream *capturestream;
#if MACOSX_COREAUDIO
AudioDeviceID deviceID;
#else