From 9ecfd1ccbea852ca09831e1a76170e88f2a63754 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 27 Feb 2008 05:57:26 +0000 Subject: [PATCH] disable adaptive mixahead when soundtimehack is non-zero (recording, etc) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8139 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snd_main.c b/snd_main.c index 632009a5..988f0109 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1549,7 +1549,10 @@ static void S_PaintAndSubmit (void) paintedtime = soundtime; // mix ahead of current position - endtime = soundtime + (unsigned int)(max(_snd_mixahead.value * (float)snd_renderbuffer->format.speed, min(3 * (soundtime - oldsoundtime), 0.3 * (float)snd_renderbuffer->format.speed))); + if (soundtimehack) + endtime = soundtime + (unsigned int)(_snd_mixahead.value * (float)snd_renderbuffer->format.speed); + else + endtime = soundtime + (unsigned int)(max(_snd_mixahead.value * (float)snd_renderbuffer->format.speed, min(3 * (soundtime - oldsoundtime), 0.3 * (float)snd_renderbuffer->format.speed))); usedframes = snd_renderbuffer->endframe - snd_renderbuffer->startframe; maxtime = paintedtime + snd_renderbuffer->maxframes - usedframes; endtime = min(endtime, maxtime); -- 2.39.2