mirror of
https://github.com/rustdesk/rustdesk
synced 2026-05-24 09:28:23 +00:00
refactor
This commit is contained in:
parent
a1a41bea06
commit
920a3c0a4f
1 changed files with 1 additions and 2 deletions
|
|
@ -41,8 +41,7 @@ impl LatencyController {
|
|||
// second, compute audio latency
|
||||
// set MAX and MIN, avoid fixing too frequently.
|
||||
pub fn check_audio(&mut self, timestamp: i64) -> bool {
|
||||
let expected =
|
||||
(Instant::now() - self.update_time).as_millis() as i64 + self.last_video_remote_ts;
|
||||
let expected = self.update_time.elapsed().as_millis() as i64 + self.last_video_remote_ts;
|
||||
let latency = expected - timestamp;
|
||||
if self.allow_audio {
|
||||
if latency.abs() > MAX_LATENCY {
|
||||
|
|
|
|||
Loading…
Reference in a new issue