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:
Ryan C. Gordon 2018-04-13 21:30:26 -04:00
parent 4f8c7c2f2f
commit 62acfb3348

View file

@ -156,13 +156,10 @@ qboolean SNDDMA_Init(void)
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" );