tidy bindings, closures and string building
This commit is contained in:
@@ -1089,7 +1089,8 @@ pub(crate) fn concat_pcm(segments: &[PathBuf], output: &Path) -> Result<()> {
|
||||
}
|
||||
let mut out = std::fs::File::create(output).context("creating audio concat file")?;
|
||||
for seg in segments {
|
||||
let mut f = std::fs::File::open(seg).with_context(|| format!("opening {seg:?}"))?;
|
||||
let mut f = std::fs::File::open(seg)
|
||||
.with_context(|| format!("opening {}", seg.display()))?;
|
||||
std::io::copy(&mut f, &mut out).context("copying audio segment")?;
|
||||
}
|
||||
out.flush()?;
|
||||
@@ -1123,7 +1124,8 @@ pub(crate) fn concat_segments(ffmpeg: &Path, segments: &[PathBuf], output: &Path
|
||||
.to_str()
|
||||
.ok_or_else(|| anyhow!("segment path is not UTF-8"))?
|
||||
.replace('\\', "/");
|
||||
body.push_str(&format!("file '{s}'\n"));
|
||||
use std::fmt::Write as _;
|
||||
let _ = writeln!(body, "file '{s}'");
|
||||
}
|
||||
std::fs::write(&list_path, body).context("writing concat list")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user