mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-23 20:41:36 +00:00
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
This commit is contained in:
parent
e6d38a8372
commit
2806d174b3
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue