From d9b99385192f990dc73313ce651faded7de6617b Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 11 Apr 2007 11:52:34 +0000 Subject: [PATCH] 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 --- snd_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.2