]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
slight improvement to sound latency math (moved it after new sound data
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 Mar 2008 01:08:42 +0000 (01:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 Mar 2008 01:08:42 +0000 (01:08 +0000)
is added)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8203 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.c

index 9c5828d77272709ae454a30588845ab462f6b271..85874f25139dfba5db325613df7f1bc77876a32c 100644 (file)
@@ -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;
 }
 
 /*