Cvar_RegisterVariable(&snd_channels);
// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
- if (COM_CheckParm("-nosound") || COM_CheckParm("-safe"))
+ if (COM_CheckParm("-nosound"))
return;
snd_mempool = Mem_AllocPool("sound", 0, NULL);
if (snd_renderbuffer == NULL || nosound.integer)
return;
- if (snd_blocked > 0 && !(cls.capturevideo.soundrate && !cls.capturevideo.realtime))
- return;
-
// Update sound time
- if (cls.capturevideo.soundrate && !cls.capturevideo.realtime) // SUPER NASTY HACK to record non-realtime sound
+ if (cls.timedemo) // SUPER NASTY HACK to mix non-realtime sound for more reliable benchmarking
+ newsoundtime = (unsigned int)((double)cl.mtime[0] * (double)snd_renderbuffer->format.speed);
+ else if (cls.capturevideo.soundrate && !cls.capturevideo.realtime) // SUPER NASTY HACK to record non-realtime sound
newsoundtime = (unsigned int)((double)cls.capturevideo.frame * (double)snd_renderbuffer->format.speed / (double)cls.capturevideo.framerate);
else if (simsound)
newsoundtime = (unsigned int)((realtime - snd_starttime) * (double)snd_renderbuffer->format.speed);
else
+ {
newsoundtime = SndSys_GetSoundTime();
+ if (snd_blocked > 0)
+ return;
+ }
newsoundtime += extrasoundtime;
if (newsoundtime < soundtime)
if (snd_renderbuffer == NULL || nosound.integer)
return;
- if (snd_blocked > 0 && !(cls.capturevideo.soundrate && !cls.capturevideo.realtime))
- return;
-
// If snd_swapstereo or snd_channellayout has changed, recompute the channel layout
if (current_swapstereo != snd_swapstereo.integer ||
current_channellayout != snd_channellayout.integer)