diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 704b33ee..f9f4bca3 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -35,6 +35,10 @@ #include #endif +#if SDL2_SUPPORT +#include +#endif + void print_usage(void); void print_help(fluid_settings_t *settings); void print_welcome(void); @@ -345,6 +349,18 @@ int main(int argc, char **argv) lash_args = fluid_lash_extract_args(&argc, &argv); #endif + +#if SDL2_SUPPORT + if (SDL_Init(SDL_INIT_AUDIO) != 0) + { + fprintf(stderr, "Warning: Unable to initialize SDL2 Audio: %s", SDL_GetError()); + } + else + { + atexit(SDL_Quit); + } +#endif + print_welcome();