]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
go back to block counting, looks like we now know what's broken with waveOut
[xonotic/darkplaces.git] / 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;
 }
 
 /*