From a826c2364d259c46bcbb4939f5abf92833c071ce Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 11 Jun 2022 23:28:43 +0200 Subject: sdl-1.2/sound.c: use SDL_WasInit --- src/sfx/sdl-1.2/src/sound.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/sfx/sdl-1.2/src/sound.c b/src/sfx/sdl-1.2/src/sound.c index d2ee40a..c7ef240 100644 --- a/src/sfx/sdl-1.2/src/sound.c +++ b/src/sfx/sdl-1.2/src/sound.c @@ -7,7 +7,7 @@ #include #include -static bool subsystem_init, mixer_init; +static bool mixer_init; void sfx_free(struct sound *const s) { @@ -73,7 +73,7 @@ void sfx_deinit(void) if (mixer_init) Mix_CloseAudio(); - if (subsystem_init) + if (SDL_WasInit(SDL_INIT_AUDIO) & SDL_INIT_AUDIO) SDL_QuitSubSystem(SDL_INIT_AUDIO); } @@ -87,8 +87,6 @@ int sfx_init(void) fprintf(stderr, "SDL_InitSubSystem: %s\n", SDL_GetError()); goto failure; } - else - subsystem_init = true; if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, CHUNK_SZ)) -- cgit v1.2.3