--- a/src/audio/SDL_audio.c Sun Aug 07 02:43:20 2016 -0400
+++ b/src/audio/SDL_audio.c Tue Aug 09 00:44:05 2016 -0400
@@ -1143,6 +1143,7 @@
const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
int allowed_changes, int min_id)
{
+ const SDL_bool is_internal_thread = (desired->callback != NULL);
SDL_AudioDeviceID id = 0;
SDL_AudioSpec _obtained;
SDL_AudioDevice *device;
@@ -1379,11 +1380,7 @@
/* !!! FIXME: we don't force the audio thread stack size here because it calls into user code, but maybe we should? */
/* buffer queueing callback only needs a few bytes, so make the stack tiny. */
char name[64];
- const SDL_bool is_internal_thread =
- (device->spec.callback == SDL_BufferQueueDrainCallback) ||
- (device->spec.callback == SDL_BufferQueueFillCallback);
const size_t stacksize = is_internal_thread ? 64 * 1024 : 0;
-
SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) device->id);
device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, name, stacksize, device);