[SDL] SDL_OpenAudio returns negative error codes in SDL2

SDL1.2 just returns -1, which this code was still checking for
This commit is contained in:
Clownacy 2018-07-01 21:33:30 +01:00
parent cb5b682872
commit 6e9cb90da4

View File

@ -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;
}