Merge pull request #1855 from CharlesBaumer/fix/doc-path-stills-windows

Windows: two fixes so cargo xtask ci gets past clippy and the media tests
This commit is contained in:
skylar taylor-barrick
2026-10-22 07:52:46 -06:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -34,9 +34,11 @@ impl Services for Recording {
}
}
/// Probes every file as a still.
/// Probes every file as a still. Only the Unix part of the test below imports files.
#[cfg(unix)]
struct Stills;
#[cfg(unix)]
impl crate::Importer for Stills {
fn probe(&self, path: &str) -> Result<Footage, String> {
if !std::path::Path::new(path).is_file() {
+5 -1
View File
@@ -40,7 +40,11 @@ fn ffmpeg_fixture(name: &str, args: &[&str]) -> Option<PathBuf> {
let tmp = out.with_file_name(format!("tmp-{}-{:?}.{ext}", std::process::id(), std::thread::current().id()).replace(['(', ')'], ""));
let st = Command::new("ffmpeg").args(["-hide_banner", "-loglevel", "error", "-y"]).args(args).arg(&tmp).status().expect("run ffmpeg");
assert!(st.success(), "ffmpeg failed for {name}");
std::fs::rename(&tmp, &out).expect("rename");
if std::fs::rename(&tmp, &out).is_err() {
// Another test made it first; on Windows the rename fails while that test has it open.
let _ = std::fs::remove_file(&tmp);
assert!(out.exists(), "rename {} to {name} failed", tmp.display());
}
Some(out)
}