mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
minor cd_sdl cleanup after r948
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@949 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
542d5fa7af
commit
797b3bd0f8
1 changed files with 8 additions and 10 deletions
|
@ -145,11 +145,10 @@ int CDAudio_Play(byte track, qboolean looping)
|
||||||
|
|
||||||
/* We have two types of stop
|
/* We have two types of stop
|
||||||
*
|
*
|
||||||
* On many devices, CDROMSTOP
|
* On some devices, the CDROMSTOP ioctl causes any followup
|
||||||
* ioctl causes any ioctls following immediately to
|
* ioctls to fail for a considerable time.
|
||||||
* fail for a considerable time.
|
* So avoid dead stops if playback may be resumed shortly.
|
||||||
* So avoid dead stops if playback may be resume shortly */
|
*/
|
||||||
|
|
||||||
void CDAudio_Stop(void)
|
void CDAudio_Stop(void)
|
||||||
{
|
{
|
||||||
if (!cd_handle || !enabled)
|
if (!cd_handle || !enabled)
|
||||||
|
@ -158,7 +157,6 @@ void CDAudio_Stop(void)
|
||||||
if (!playing)
|
if (!playing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (SDL_CDPause(cd_handle) == -1)
|
if (SDL_CDPause(cd_handle) == -1)
|
||||||
Con_Printf ("CDAudio_Stop: Unable to pause CD-ROM (%s)\n", SDL_GetError());
|
Con_Printf ("CDAudio_Stop: Unable to pause CD-ROM (%s)\n", SDL_GetError());
|
||||||
|
|
||||||
|
@ -177,7 +175,7 @@ void CDAudio_ReallyStop(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (SDL_CDStop(cd_handle) == -1)
|
if (SDL_CDStop(cd_handle) == -1)
|
||||||
Con_Printf ("CDAudio_ReallyStop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
|
Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
|
||||||
|
|
||||||
wasPlaying = false;
|
wasPlaying = false;
|
||||||
playing = false;
|
playing = false;
|
||||||
|
@ -353,8 +351,7 @@ static void CD_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Con_Printf("cd: \"%s\" unknown command.\n",command);
|
Con_Printf("cd: unknown command \"%s\".\n",command);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static qboolean CD_GetVolume (void *unused)
|
static qboolean CD_GetVolume (void *unused)
|
||||||
|
@ -564,9 +561,10 @@ void CDAudio_Shutdown(void)
|
||||||
{
|
{
|
||||||
if (!cd_handle)
|
if (!cd_handle)
|
||||||
return;
|
return;
|
||||||
CDAudio_ReallyStop();
|
CDAudio_Stop();
|
||||||
if (hw_vol_works)
|
if (hw_vol_works)
|
||||||
CD_SetVolume (NULL); /* no SDL support at present. */
|
CD_SetVolume (NULL); /* no SDL support at present. */
|
||||||
|
CDAudio_ReallyStop();
|
||||||
SDL_CDClose(cd_handle);
|
SDL_CDClose(cd_handle);
|
||||||
cd_handle = NULL;
|
cd_handle = NULL;
|
||||||
cd_dev = -1;
|
cd_dev = -1;
|
||||||
|
|
Loading…
Reference in a new issue