X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cd_linux.c;h=bc07b849f9febd274d719cdf36a2d3e7ca7699a5;hb=c4fcd15162dfb3e4f467a35d6a827611b8ac9d42;hp=b0e4fb0093d26a46a67d08dab4f783522bcb52b6;hpb=6824d8ddc8a43cae0609be5bbe8bee01fa1a4225;p=xonotic%2Fdarkplaces.git diff --git a/cd_linux.c b/cd_linux.c index b0e4fb00..bc07b849 100644 --- a/cd_linux.c +++ b/cd_linux.c @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // rights reserved. // suggested by Zero_Dogg to fix a compile problem on Mandriva Linux -#define __KERNEL_STRICT_NAMES +#include "quakedef.h" #include #include @@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include "quakedef.h" #include "cdaudio.h" @@ -105,7 +104,7 @@ void CDAudio_SysSetVolume (float volume) if (cdfile == -1) return; - vol.channel0 = vol.channel1 = volume * 255; + vol.channel0 = vol.channel1 = (__u8)(volume * 255); vol.channel2 = vol.channel3 = 0; if (ioctl (cdfile, CDROMVOLCTRL, &vol) == -1) @@ -113,7 +112,7 @@ void CDAudio_SysSetVolume (float volume) } -int CDAudio_SysPlay (unsigned char track) +int CDAudio_SysPlay (int track) { struct cdrom_tocentry entry; struct cdrom_ti ti; @@ -204,7 +203,7 @@ int CDAudio_SysUpdate (void) struct cdrom_subchnl subchnl; static time_t lastchk = 0; - if (cdPlaying && lastchk < time(NULL)) + if (cdPlaying && lastchk < time(NULL) && cdfile != -1) { lastchk = time(NULL) + 2; //two seconds between chks subchnl.cdsc_format = CDROM_MSF;