mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-25 00:49:47 +00:00
(SDL) Fix double initialization
Signed-off-by: Higor Eurípedes <heuripedes@gmail.com>
This commit is contained in:
parent
0f7c67daab
commit
e88f3b4355
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user