Skip to content

Commit

Permalink
Fix init SDL3 subsystem
Browse files Browse the repository at this point in the history
Fix init SDL3 subsystem
  • Loading branch information
andyvand committed Feb 1, 2025
1 parent c74e2ea commit 801c118
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/drivers/fluid_sdl3.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ void fluid_sdl3_audio_driver_settings(fluid_settings_t *settings)
return;
}

if(!SDL_InitSubSystem(SDL_INIT_AUDIO))
{
#if FLUID_VERSION_CHECK(FLUIDSYNTH_VERSION_MAJOR, FLUIDSYNTH_VERSION_MINOR, FLUIDSYNTH_VERSION_MICRO) < FLUID_VERSION_CHECK(2,2,0)
FLUID_LOG(FLUID_WARN, "SDL3 subsystem not initialized, SDL3 audio driver won't be usable");
#endif
return;
}

list= SDL_malloc(sizeof(AudioDeviceList));
devices = SDL_GetAudioPlaybackDevices(&nDevs);

Expand Down Expand Up @@ -426,6 +434,8 @@ void delete_fluid_sdl3_audio_driver(fluid_audio_driver_t *d)

FLUID_FREE(dev);
}

SDL_QuitSubSystem(SDL_INIT_AUDIO);
}

#endif /* SDL3_SUPPORT */

0 comments on commit 801c118

Please sign in to comment.