From 6c6f66914d9b7c879dd1d043e8d5e0323a4c9caa Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 10 Jun 2020 07:30:36 -0700 Subject: [PATCH] VIDEO: Explicitly initialize and cleanup SDL Audio subsystem As mentioned in #873, there didn't appear to be a problem at runtime, but the formal definition suggests SDL_InitSubSystem and its cleanup should be called. It is likely that, as a vestige of SDL 1.2, SDL_OpenAudio is doing this under the covers. No harm adding it. --- sim_video.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sim_video.c b/sim_video.c index 24d1a78d..683478a6 100644 --- a/sim_video.c +++ b/sim_video.c @@ -2194,6 +2194,7 @@ if (!vid_beep_data) { int i; SDL_AudioSpec desiredSpec; + SDL_InitSubSystem (SDL_INIT_AUDIO); memset (&desiredSpec, 0, sizeof(desiredSpec)); desiredSpec.freq = SAMPLE_FREQUENCY; desiredSpec.format = AUDIO_S16SYS; @@ -2216,6 +2217,7 @@ static void vid_beep_cleanup (void) SDL_CloseAudio(); free (vid_beep_data); vid_beep_data = NULL; +SDL_QuitSubSystem (SDL_INIT_AUDIO); } void vid_beep_event (void)