diff --git a/audio/sdl_audio.c b/audio/sdl_audio.c index e1bd5ab5ee..db9107e99f 100644 --- a/audio/sdl_audio.c +++ b/audio/sdl_audio.c @@ -60,8 +60,11 @@ static inline int find_num_frames(int rate, int latency) static void *sdl_audio_init(const char *device, unsigned rate, unsigned latency) { (void)device; - if (SDL_WasInit(0) == 0 && SDL_Init(SDL_INIT_AUDIO) < 0) - return NULL; + if (SDL_WasInit(0) == 0) + { + if (SDL_Init(SDL_INIT_AUDIO) < 0) + return NULL; + } else if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) return NULL; diff --git a/gfx/sdl2_gfx.c b/gfx/sdl2_gfx.c index a292a90407..215e86da47 100644 --- a/gfx/sdl2_gfx.c +++ b/gfx/sdl2_gfx.c @@ -369,8 +369,11 @@ static void *sdl2_gfx_init(const video_info_t *video, const input_driver_t **inp int i; - if (SDL_WasInit(0) == 0 && SDL_Init(SDL_INIT_VIDEO) < 0) - return NULL; + if (SDL_WasInit(0) == 0) + { + if (SDL_Init(SDL_INIT_VIDEO) < 0) + return NULL; + } else if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) return NULL; diff --git a/input/sdl_joypad.c b/input/sdl_joypad.c index 203fdd1a5a..2aee0b569a 100644 --- a/input/sdl_joypad.c +++ b/input/sdl_joypad.c @@ -124,8 +124,11 @@ static void sdl_joypad_destroy(void) static bool sdl_joypad_init(void) { unsigned i; - if (SDL_WasInit(0) == 0 && SDL_Init(SDL_INIT_JOYSTICK) < 0) - return false; + if (SDL_WasInit(0) == 0) + { + if (SDL_Init(SDL_INIT_JOYSTICK) < 0) + return false; + } else if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) return false;