update hwcodec (#12303)

* Test necessary codecs in single thread
* Terminate test process with parent process

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-07-15 18:49:45 +08:00
committed by GitHub
parent abb7748ee9
commit 69af5f2fa6
2 changed files with 5 additions and 1 deletions

View File

@@ -678,6 +678,8 @@ impl HwCodecConfig {
}
pub fn check_available_hwcodec() -> String {
#[cfg(any(target_os = "linux", target_os = "macos"))]
hwcodec::common::setup_parent_death_signal();
let ctx = EncodeContext {
name: String::from(""),
mc_name: None,
@@ -724,6 +726,8 @@ pub fn start_check_process() {
if let Some(_) = exe.file_name().to_owned() {
let arg = "--check-hwcodec-config";
if let Ok(mut child) = std::process::Command::new(exe).arg(arg).spawn() {
#[cfg(windows)]
hwcodec::common::child_exit_when_parent_exit(child.id());
// wait up to 30 seconds, it maybe slow on windows startup for poorly performing machines
for _ in 0..30 {
std::thread::sleep(std::time::Duration::from_secs(1));