From 6e9cb90da4bb98d8cfe4dc17a1991d615969039a Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 1 Jul 2018 21:33:30 +0100 Subject: [PATCH] [SDL] SDL_OpenAudio returns negative error codes in SDL2 SDL1.2 just returns -1, which this code was still checking for --- sdl/sdl2/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdl/sdl2/main.c b/sdl/sdl2/main.c index 6489ca8..52d4b83 100644 --- a/sdl/sdl2/main.c +++ b/sdl/sdl2/main.c @@ -82,7 +82,7 @@ static int sdl_sound_init() as_desired.samples = SOUND_SAMPLES_SIZE; as_desired.callback = sdl_sound_callback; - if(SDL_OpenAudio(&as_desired, NULL) == -1) { + if(SDL_OpenAudio(&as_desired, NULL) < 0) { SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "SDL Audio open failed", sdl_video.window); return 0; }