diff --git a/Cargo.lock b/Cargo.lock index 23c750244..de75588ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "default_net" version = "0.1.0" -source = "git+https://github.com/rustdesk-org/default_net#c400b0bbf49a987129796221fbc41a8a385b812e" +source = "git+https://github.com/rustdesk-org/default_net#78f8f70cd85151a3a2c4a3230d80d5272703c02e" dependencies = [ "anyhow", "regex", diff --git a/src/server/video_qos.rs b/src/server/video_qos.rs index 51939515c..108af9f44 100644 --- a/src/server/video_qos.rs +++ b/src/server/video_qos.rs @@ -117,7 +117,7 @@ impl Default for VideoQoS { fn default() -> Self { VideoQoS { fps: FPS, - ratio: 1.0, + ratio: BR_BALANCED, users: Default::default(), displays: Default::default(), bitrate_store: 0, @@ -327,7 +327,8 @@ impl VideoQoS { user.delay.fps = Some(fps); } self.adjust_fps(); - if adjust_ratio { + if adjust_ratio && !cfg!(target_os = "linux") { + //Reduce the possibility of vaapi being created twice self.adjust_ratio(false); } } @@ -412,6 +413,9 @@ impl VideoQoS { // Adjust quality ratio based on network delay and screen changes fn adjust_ratio(&mut self, dynamic_screen: bool) { + if !self.in_vbr_state() { + return; + } // Get maximum delay from all users let max_delay = self.users.iter().map(|u| u.1.delay.avg_delay()).max(); let Some(max_delay) = max_delay else {