[client] audio: fix latency calculation

This commit is contained in:
Geoffrey McRae 2022-01-19 00:58:48 +11:00
parent 4b080f7610
commit 46da447429

View File

@ -356,9 +356,8 @@ void audio_tick(unsigned long long tickCount)
if (audio.audioDev->playback.latency) if (audio.audioDev->playback.latency)
frames += audio.audioDev->playback.latency(); frames += audio.audioDev->playback.latency();
const float latency = frames > 0
? audio.playback.sampleRate / (float)frames const float latency = frames / (float)(audio.playback.sampleRate / 1000);
: 0.0f;
ringbuffer_push(audio.playback.timings, &latency); ringbuffer_push(audio.playback.timings, &latency);