mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
update crates, and set new default #cpu
This commit is contained in:
@@ -638,7 +638,7 @@ pub struct VideoHandler {
|
||||
impl VideoHandler {
|
||||
pub fn new() -> Self {
|
||||
VideoHandler {
|
||||
decoder: Decoder::new(VideoCodecId::VP9, 0).unwrap(),
|
||||
decoder: Decoder::new(VideoCodecId::VP9, (num_cpus::get() / 2) as _).unwrap(),
|
||||
rgb: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,8 +307,8 @@ async fn check_pid(postfix: &str) {
|
||||
use sysinfo::{ProcessExt, System, SystemExt};
|
||||
let mut sys = System::new();
|
||||
sys.refresh_processes();
|
||||
if let Some(p) = sys.process(pid) {
|
||||
if let Some(current) = sys.process(std::process::id() as _) {
|
||||
if let Some(p) = sys.process(pid.into()) {
|
||||
if let Some(current) = sys.process((std::process::id() as i32).into()) {
|
||||
if current.name() == p.name() {
|
||||
// double check with connect
|
||||
if connect(1000, postfix).await.is_ok() {
|
||||
|
||||
@@ -188,7 +188,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
||||
speed,
|
||||
};
|
||||
let mut vpx;
|
||||
match Encoder::new(&cfg, 0) {
|
||||
match Encoder::new(&cfg, (num_cpus::get() / 2) as _) {
|
||||
Ok(x) => vpx = x,
|
||||
Err(err) => bail!("Failed to create encoder: {}", err),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user