Cvar_RegisterVariable(&volume);
Cvar_RegisterVariable(&bgmvolume);
- if (COM_CheckParm("-nosound"))
+ if (COM_CheckParm("-nosound") || COM_CheckParm("-safe"))
return;
snd_mempool = Mem_AllocPool("sound");
void S_TouchSound (char *name)
{
sfx_t *sfx;
-
+
if (!sound_started)
return;
// mix ahead of current position
endtime = soundtime + _snd_mixahead.value * shm->speed;
samps = shm->samples >> (shm->channels-1);
- if (endtime - soundtime > samps)
+ if (endtime > (unsigned int)(soundtime + samps))
endtime = soundtime + samps;
#ifdef _WIN32
out[i] = in[i];
//Con_Printf("S_RawSamples_Dequeue: normal %i\n", l);
}
- if (l < length)
+ if (l < (int)length)
{
memset(samples + l * 2, 0, (length - l) * sizeof(int[2]));
//Con_Printf("S_RawSamples_Dequeue: padding with %i samples\n", length - l);
else
memcpy(output, input, inputlength * sizeof(short[2]));
}
+
+int S_RawSamples_SampleRate(void)
+{
+ return shm != NULL ? shm->speed : 0;
+}