From 886736a2c8f58723c8e63411122d5f171aaaf988 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 11 Feb 2017 16:38:16 -0800 Subject: [PATCH] Fixed bug 3584 - Small stack size for audio callback thread Walter van Niftrik We have found that since SDL 2.0.5 the audio callback thread is created with a very small stack size. In our application this is leading to stack overflows. We believe there is a bug at http://hg.libsdl.org/SDL/file/391fd532f79e/src/audio/SDL_audio.c#l1132, where the is_internal_thread flag appears to be inverted. --- src/audio/SDL_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index a4fcd1110e03d..989259ca1a332 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1129,7 +1129,7 @@ open_audio_device(const char *devname, int iscapture, const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, int allowed_changes, int min_id) { - const SDL_bool is_internal_thread = (desired->callback != NULL); + const SDL_bool is_internal_thread = (desired->callback == NULL); SDL_AudioDeviceID id = 0; SDL_AudioSpec _obtained; SDL_AudioDevice *device;