From ead7152d060fb655bfdff20606e0c0ff8e685c76 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 9 Mar 2008 01:08:42 +0000 Subject: [PATCH] slight improvement to sound latency math (moved it after new sound data is added) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8203 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snd_main.c b/snd_main.c index 9c5828d7..85874f25 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1483,13 +1483,9 @@ static void S_PaintAndSubmit (void) static int soundtimehack = -1; static int oldsoundtime = 0; - cls.soundstats.latency_milliseconds = -1; - if (snd_renderbuffer == NULL || nosound.integer) return; - cls.soundstats.latency_milliseconds = (snd_renderbuffer->endframe - snd_renderbuffer->startframe) * 1000 / snd_renderbuffer->format.speed; - // Update sound time snd_usethreadedmixing = false; usesoundtimehack = true; @@ -1620,6 +1616,8 @@ static void S_PaintAndSubmit (void) SndSys_Submit(); oldsoundtime = soundtime; + + cls.soundstats.latency_milliseconds = (snd_renderbuffer->endframe - snd_renderbuffer->startframe) * 1000 / snd_renderbuffer->format.speed; } /* -- 2.39.2