mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
sdl_snd.c should just initialize SDL audio without checking SDL_WasInit().
In SDL2, the initialized subsystems are referenced counted, so it's safe to initialize them twice, and it makes the SDL_QuitSubSystem during our shutdown correctly decrement the count. Before (as a probably-harmless bug), it would not increment the refcount if the subsystem was already initialized, causing problems when it decremented it later.
This commit is contained in:
parent
4f8c7c2f2f
commit
62acfb3348
1 changed files with 3 additions and 6 deletions
|
@ -156,13 +156,10 @@ qboolean SNDDMA_Init(void)
|
||||||
|
|
||||||
Com_Printf( "SDL_Init( SDL_INIT_AUDIO )... " );
|
Com_Printf( "SDL_Init( SDL_INIT_AUDIO )... " );
|
||||||
|
|
||||||
if (!SDL_WasInit(SDL_INIT_AUDIO))
|
if (SDL_Init(SDL_INIT_AUDIO) != 0)
|
||||||
{
|
{
|
||||||
if (SDL_Init(SDL_INIT_AUDIO) != 0)
|
Com_Printf( "FAILED (%s)\n", SDL_GetError( ) );
|
||||||
{
|
return qfalse;
|
||||||
Com_Printf( "FAILED (%s)\n", SDL_GetError( ) );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Com_Printf( "OK\n" );
|
Com_Printf( "OK\n" );
|
||||||
|
|
Loading…
Reference in a new issue