mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix qos and add auto_adjust_fps
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -535,11 +535,10 @@ pub fn codec_thread_num() -> usize {
|
||||
info = format!("cpu loadavg:{}", avg.one);
|
||||
res = (((max as f64) - avg.one) * 0.5).round() as usize;
|
||||
}
|
||||
res = if res > 0 && res <= max / 2 {
|
||||
res
|
||||
} else {
|
||||
std::cmp::max(1, max / 2)
|
||||
};
|
||||
res = std::cmp::min(res, max / 2);
|
||||
if res == 0 {
|
||||
res = 1;
|
||||
}
|
||||
// avoid frequent log
|
||||
let log = match THREAD_LOG_TIME.lock().unwrap().clone() {
|
||||
Some(instant) => instant.elapsed().as_secs() > 1,
|
||||
|
||||
Reference in New Issue
Block a user