diff --git a/libs/scrap/src/common/hwcodec.rs b/libs/scrap/src/common/hwcodec.rs index fa1c00976..f55fd452a 100644 --- a/libs/scrap/src/common/hwcodec.rs +++ b/libs/scrap/src/common/hwcodec.rs @@ -3,7 +3,7 @@ use crate::{ hw, ImageFormat, HW_STRIDE_ALIGN, }; use hbb_common::{ - anyhow::{anyhow, Context}, + anyhow::{allow_err, anyhow, Context}, bytes::Bytes, config::HwCodecConfig, get_time, lazy_static, log, @@ -352,7 +352,19 @@ pub fn check_config_process(force_reset: bool) { let second = 3; std::thread::sleep(std::time::Duration::from_secs(second)); // kill: Different platforms have different results - child.kill().ok(); + allow_err!(child.kill()); + std::thread::sleep(std::time::Duration::from_millis(30)); + match ps.try_wait() { + Ok(Some(status)) => log::info!("Check hwcodec config, exit with: {status}"), + Ok(None) => { + log::info!( + "Check hwcodec config, status not ready yet, let's really wait" + ); + let res = child.wait(); + log::info!("Check hwcodec config, wait result: {res:?}"); + } + Err(e) => println!("Check hwcodec config, error attempting to wait: {e}"), + } HwCodecConfig::refresh(); } }