The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
SDL_CloseAudio() taking too long
Aero Super
Guest
Posted: Thu Feb 10, 2011 12:07 am
Hello,
I'm having a problem using SDL audio and I'm trying to find the cause of it.
The call to SDL_CloseAudio() takes 2 seconds to complete. Is this expected behavior? For my purpose it is too slow.
In rare cases it doesn't take almost no time at all.
I found out that the slow down is at the line
audio->WaitDone(audio);
in SDL_audio.c .
I use pulseaudio so I went to PULSE_WaitDone() in SDL_pulseaudio.c .
It looks like the program gets stuck inside the while loop.
When it takes 2 seconds, the loop runs 13 times. When it is fast, the loop runs 5 times.