mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-19 00:13:01 +08:00
refactor
This commit is contained in:
parent
a1a41bea06
commit
920a3c0a4f
@ -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 New Issue
Block a user