Mercurial > hg > dmlib
changeset 278:919e7de91758
Improve locking.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Oct 2012 22:18:05 +0300 |
parents | 2e04f6827a52 |
children | 5acc1232c8c0 |
files | dmsimple.c |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/dmsimple.c Wed Oct 10 22:17:55 2012 +0300 +++ b/dmsimple.c Wed Oct 10 22:18:05 2012 +0300 @@ -308,7 +308,6 @@ static const int nengineResOps = sizeof(engineResOps) / sizeof(engineResOps[0]); - static int engineClassifier(DMResource *res) { int i; @@ -619,7 +618,11 @@ #endif dmPrint(1, "Starting up.\n"); + + SDL_LockAudio(); SDL_PauseAudio(0); + SDL_UnlockAudio(); + engine.startTime = SDL_GetTicks(); while (!engine.exitFlag) @@ -719,18 +722,18 @@ dmPrint(1, "Shutting down.\n"); SDL_ShowCursor(SDL_ENABLE); - SDL_PauseAudio(1); if (engine.screen) SDL_FreeSurface(engine.screen); + SDL_LockAudio(); + SDL_PauseAudio(1); #ifdef DM_USE_JSS - SDL_LockAudio(); jmpClose(engine.plr); jvmClose(engine.dev); jssClose(); +#endif SDL_UnlockAudio(); -#endif dmres_close();