mirror of
https://github.com/simh/simh.git
synced 2026-02-26 16:54:22 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user