SDL_CloseAudio cause deadloop?

Hi guys,

We use SDL to develop some video games. While testing, we found that
the game will be in a deadloop like status when we call SDL_CloseAudio().

It means:

(1) The game is not dead. It is still Running.
(2) The game occupies almost 99.5% CPU time :frowning:
(3) When we switch to another terminal and kill the game. All things will
be okay again.

We set a log before and after that, just like :

main()
{

syslog(LOG_INFO,"Before close()");
SDL_CloseAudio();
syslog(LOG_INFO, "After close()");
SDL_CloseGraphics();
syslog(LOG_INFO, "Exit!!");
return 0;

}

We only got a “Before close()”. When kill the game, we got "After close()"
and “Exit!!”.

Are there anyone can help?

Thanks,

Rock

Hi guys,

[snip]
We only got a “Before close()”. When kill the game, we got "After close()"
and “Exit!!”.

Are there anyone can help?

Since you do get the “After close()” & “Exit!!” messages, SDL_CloseAudio()
probably isn’t causing the problem. (after you kill the process, it can’t
log anymore, right?). It looks like SDL_CloseAudio() somehow forces a flush
of the log file buffer, since you do see the “Before close()” message.

The ‘hang’ must happen after logging the “Exit!!” message.

----- Original Message -----
From: rockt@uwink.com.cn [mailto:rockt at uwink.com.cn]
Sent: maandag 5 november 2001 12:00
To: sdl at libsdl.org
Subject: [SDL] SDL_CloseAudio cause deadloop??

I just found that if SDL_LockAudio was called, you must SDL_UnlockAudio
first before shutting it down or it won’t.On Mon, Nov 05, 2001 at 10:59:46AM -0000, rockt at uwink.com.cn wrote:

We use SDL to develop some video games. While testing, we found that
the game will be in a deadloop like status when we call SDL_CloseAudio().

It means:

(1) The game is not dead. It is still Running.
(2) The game occupies almost 99.5% CPU time :frowning:
(3) When we switch to another terminal and kill the game. All things will
be okay again.


Joseph Carter Free software developer

If we want something nice to get born in nine months, then sex has to
happen. We want to have the kind of sex that is acceptable and fun for both
people, not the kind where someone is getting screwed. Let’s get some cross
fertilization, but not someone getting screwed.
– Larry Wall

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20011105/6aad85f7/attachment.pgp