Merge pull request #6150 from 21pages/hwcodec_check5
hwcodec check wait more time
This commit is contained in:
commit
dcad8a9f79
@ -569,7 +569,7 @@ impl Config {
|
|||||||
|
|
||||||
pub fn get_home() -> PathBuf {
|
pub fn get_home() -> PathBuf {
|
||||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||||
return Self::path(APP_HOME_DIR.read().unwrap().as_str());
|
return PathBuf::from(APP_HOME_DIR.read().unwrap().as_str());
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
{
|
{
|
||||||
if let Some(path) = dirs_next::home_dir() {
|
if let Some(path) = dirs_next::home_dir() {
|
||||||
|
@ -362,13 +362,14 @@ pub fn check_config_process() {
|
|||||||
let f = || {
|
let f = || {
|
||||||
// Clear to avoid checking process errors
|
// Clear to avoid checking process errors
|
||||||
// But when the program is just started, the configuration file has not been updated, and the new connection will read an empty configuration
|
// But when the program is just started, the configuration file has not been updated, and the new connection will read an empty configuration
|
||||||
|
// TODO: --server start multi times on windows startup, which will clear the last config and cause concurrent file writing
|
||||||
HwCodecConfig::clear();
|
HwCodecConfig::clear();
|
||||||
if let Ok(exe) = std::env::current_exe() {
|
if let Ok(exe) = std::env::current_exe() {
|
||||||
if let Some(_) = exe.file_name().to_owned() {
|
if let Some(_) = exe.file_name().to_owned() {
|
||||||
let arg = "--check-hwcodec-config";
|
let arg = "--check-hwcodec-config";
|
||||||
if let Ok(mut child) = std::process::Command::new(exe).arg(arg).spawn() {
|
if let Ok(mut child) = std::process::Command::new(exe).arg(arg).spawn() {
|
||||||
// wait up to 10 seconds
|
// wait up to 30 seconds, it maybe slow on windows startup for poorly performing machines
|
||||||
for _ in 0..10 {
|
for _ in 0..30 {
|
||||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||||
if let Ok(Some(_)) = child.try_wait() {
|
if let Ok(Some(_)) = child.try_wait() {
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user