From: havoc Date: Wed, 11 Apr 2007 11:52:34 +0000 (+0000) Subject: added cls.timedemo check in S_PaintAndSubmit to use cl.mtime[0] for sound sync when... X-Git-Tag: xonotic-v0.1.0preview~3346 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d9b99385192f990dc73313ce651faded7de6617b;p=xonotic%2Fdarkplaces.git added cls.timedemo check in S_PaintAndSubmit to use cl.mtime[0] for sound sync when doing timedemos, this greatly improves the accuracy of benchmarks with respect to sound mixing time git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7079 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_main.c b/snd_main.c index 0462d380..9c6bd696 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1435,7 +1435,9 @@ static void S_PaintAndSubmit (void) 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);