mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-10 18:06:01 +02:00
fix vaapi create 2 times at first (#10576)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
ec3ba5be8e
commit
da80f3352a
2 changed files with 7 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -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",
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue