From 2806d174b3c009d9e2b3c4a2d8cfc5dbae5ccd59 Mon Sep 17 00:00:00 2001 From: sezero Date: Tue, 13 Mar 2018 08:50:03 +0000 Subject: [PATCH] cd_sdl.c: change SDL_CD error return checks from '== -1' back to '< 0' SDL man pages are wrong. e.g. their macosx cdrom backend returns some negative value, but not strictly -1. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1569 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/cd_sdl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quakespasm/Quake/cd_sdl.c b/quakespasm/Quake/cd_sdl.c index e0c8e501..69bd3fae 100644 --- a/quakespasm/Quake/cd_sdl.c +++ b/quakespasm/Quake/cd_sdl.c @@ -65,7 +65,7 @@ static void CDAudio_Eject(void) #ifdef __linux__ SDL_CDStop(cd_handle); /* see CDAudio_Stop() */ #endif - if (SDL_CDEject(cd_handle) == -1) + if (SDL_CDEject(cd_handle) < 0) Con_Printf ("Unable to eject CD-ROM: %s\n", SDL_GetError ()); } @@ -119,7 +119,7 @@ int CDAudio_Play(byte track, qboolean looping) CDAudio_Stop(); } - if (SDL_CDPlay(cd_handle, cd_handle->track[track-1].offset, cd_handle->track[track-1].length) == -1) + if (SDL_CDPlay(cd_handle, cd_handle->track[track-1].offset, cd_handle->track[track-1].length) < 0) { Con_Printf ("CDAudio_Play: Unable to play track %d: %s\n", track, SDL_GetError ()); return -1; @@ -160,10 +160,10 @@ void CDAudio_Stop(void) * firmware versions running under a 2.6.27.25 kernel, and with a * Samsung DVD r/w drive running under 2.6.35.6 kernel. * Therefore, avoid dead stops if playback may be resumed shortly. */ - if (SDL_CDPause(cd_handle) == -1) + if (SDL_CDPause(cd_handle) < 0) Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError()); #else - if (SDL_CDStop(cd_handle) == -1) + if (SDL_CDStop(cd_handle) < 0) Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError()); #endif @@ -181,7 +181,7 @@ void CDAudio_Pause(void) if (!playing) return; - if (SDL_CDPause(cd_handle) == -1) + if (SDL_CDPause(cd_handle) < 0) Con_Printf ("Unable to pause CD-ROM: %s\n", SDL_GetError()); wasPlaying = playing; @@ -200,7 +200,7 @@ void CDAudio_Resume(void) if (!wasPlaying) return; - if (SDL_CDResume(cd_handle) == -1) + if (SDL_CDResume(cd_handle) < 0) Con_Printf ("Unable to resume CD-ROM: %s\n", SDL_GetError()); playing = true; endOfTrack += realtime - pausetime;