Remove round from pulse get_latency_pcm, floor math is fine

This commit is contained in:
JasonLG1979 2023-06-24 15:26:29 -05:00
parent 74b52e83fa
commit 0bdfa726ca

View file

@ -140,9 +140,9 @@ impl Sink for PulseAudioSink {
self.sink self.sink
.as_mut() .as_mut()
.and_then(|sink| { .and_then(|sink| {
sink.get_latency().ok().map(|micro_sec| { sink.get_latency()
(micro_sec.as_secs_f64() * DECODER_SAMPLE_RATE as f64).round() as u64 .ok()
}) .map(|micro_sec| (micro_sec.as_secs_f64() * DECODER_SAMPLE_RATE as f64) as u64)
}) })
.unwrap_or(0) .unwrap_or(0)
} }