mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-04 00:33:12 +00:00
refactor
This commit is contained in:
1 parent
a1a41bea06
commit
920a3c0a4f
1 file changed
+1
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user