X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cd_sdl.c;h=c508fc02eeabb021028ac479c545c200d7b76516;hb=4c7b42b047585a7e609ec241b0e9c7e14ee11103;hp=9e6cb034c32099cffb5acb9b9b09d6b218af8e4f;hpb=018a018ec785d71f4a83e95c5962910e839d66fe;p=xonotic%2Fdarkplaces.git diff --git a/cd_sdl.c b/cd_sdl.c index 9e6cb034..c508fc02 100644 --- a/cd_sdl.c +++ b/cd_sdl.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "cdaudio.h" #include -/*IMPORTANT: +/*IMPORTANT: SDL 1.2.7 and older seems to have a strange bug regarding CDPause and CDResume under WIN32. If CDResume is called, it plays to end of the CD regardless what values for lasttrack and lastframe were passed to CDPlayTracks. @@ -80,7 +80,7 @@ void CDAudio_SysSetVolume (float volume) } -int CDAudio_SysPlay (qbyte track) +int CDAudio_SysPlay (int track) { SDL_CDStop( cd ); endtime = realtime + (float) cd->track[ track - 1 ].length / CD_FPS; @@ -129,10 +129,10 @@ int CDAudio_SysUpdate (void) void CDAudio_SysInit (void) { - if( SDL_InitSubSystem( SDL_INIT_CDROM ) == -1 ) + if( SDL_InitSubSystem( SDL_INIT_CDROM ) == -1 ) Con_Print( "Failed to init the CDROM SDL subsystem!\n" ); - Cmd_AddCommand( "cddrive", CDAudio_SDL_CDDrive_f ); + Cmd_AddCommand( "cddrive", CDAudio_SDL_CDDrive_f, "select an SDL-detected CD drive by number" ); } static int IsAudioCD( void ) @@ -148,7 +148,7 @@ int CDAudio_SysStartup (void) { int i; int numdrives; - + numdrives = SDL_CDNumDrives(); if( numdrives == -1 ) // was the CDROM system initialized correctly? return -1; @@ -210,8 +210,8 @@ void CDAudio_SDL_CDDrive_f( void ) if( !cd ) { Con_Printf( "Couldn't open drive %i.\n", i ); return; - } - + } + if( !CD_INDRIVE( SDL_CDStatus( cd ) ) ) Con_Printf( "No cd in drive %i.\n", i ); else if( !IsAudioCD() ) @@ -224,4 +224,4 @@ void CDAudio_SDL_CDDrive_f( void ) - +