delete RustDesk_hwcodec.toml on every check
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
f2aeff974c
commit
be2e26e758
@ -108,7 +108,7 @@ impl Encoder {
|
|||||||
codec: Box::new(hw),
|
codec: Box::new(hw),
|
||||||
}),
|
}),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
check_config_process(true);
|
check_config_process();
|
||||||
*CODEC_NAME.lock().unwrap() = CodecName::VP9;
|
*CODEC_NAME.lock().unwrap() = CodecName::VP9;
|
||||||
Err(e)
|
Err(e)
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ impl HwDecoder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if fail {
|
if fail {
|
||||||
check_config_process(true);
|
check_config_process();
|
||||||
}
|
}
|
||||||
HwDecoders { h264, h265 }
|
HwDecoders { h264, h265 }
|
||||||
}
|
}
|
||||||
@ -323,13 +323,11 @@ pub fn check_config() {
|
|||||||
log::error!("Failed to serialize codec info");
|
log::error!("Failed to serialize codec info");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_config_process(force_reset: bool) {
|
pub fn check_config_process() {
|
||||||
use hbb_common::sysinfo::{ProcessExt, System, SystemExt};
|
use hbb_common::sysinfo::{ProcessExt, System, SystemExt};
|
||||||
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
if force_reset {
|
HwCodecConfig::remove();
|
||||||
HwCodecConfig::remove();
|
|
||||||
}
|
|
||||||
if let Ok(exe) = std::env::current_exe() {
|
if let Ok(exe) = std::env::current_exe() {
|
||||||
if let Some(file_name) = exe.file_name().to_owned() {
|
if let Some(file_name) = exe.file_name().to_owned() {
|
||||||
let s = System::new_all();
|
let s = System::new_all();
|
||||||
|
@ -389,7 +389,7 @@ pub async fn start_server(is_server: bool) {
|
|||||||
use std::sync::Once;
|
use std::sync::Once;
|
||||||
static ONCE: Once = Once::new();
|
static ONCE: Once = Once::new();
|
||||||
ONCE.call_once(|| {
|
ONCE.call_once(|| {
|
||||||
scrap::hwcodec::check_config_process(false);
|
scrap::hwcodec::check_config_process();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user