mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-09 22:40:37 +00:00
improve ffprobe error
This commit is contained in:
parent
30837dbca2
commit
5b91a37318
@ -98,7 +98,11 @@ impl WritingFileAdapter for FFmpegAdapter {
|
||||
.await
|
||||
.map_err(spawn_fail)?;
|
||||
if !probe.status.success() {
|
||||
return Err(format_err!("ffprobe failed: {:?}", probe.status));
|
||||
return Err(format_err!(
|
||||
"ffprobe failed: {:?}\n{}",
|
||||
probe.status,
|
||||
String::from_utf8_lossy(&probe.stderr)
|
||||
));
|
||||
}
|
||||
let p: FFprobeOutput = serde_json::from_slice(&probe.stdout)?;
|
||||
!p.streams.is_empty()
|
||||
|
@ -198,16 +198,19 @@ pub async fn loop_adapt_inner(
|
||||
ai: AdaptInfo,
|
||||
) -> anyhow::Result<AdaptedFilesIterBox> {
|
||||
let fph = ai.filepath_hint.clone();
|
||||
let inp = adapter
|
||||
.adapt(ai, &detection_reason)
|
||||
.await
|
||||
.with_context(|| {
|
||||
let inp = adapter.adapt(ai, &detection_reason).await;
|
||||
let inp = if adapter.metadata().name == "postprocprefix" {
|
||||
// don't add confusing error context
|
||||
inp?
|
||||
} else {
|
||||
inp.with_context(|| {
|
||||
format!(
|
||||
"adapting {} via {} failed",
|
||||
fph.to_string_lossy(),
|
||||
adapter.metadata().name
|
||||
)
|
||||
})?;
|
||||
})?
|
||||
};
|
||||
let s = stream! {
|
||||
for await file in inp {
|
||||
match buf_choose_adapter(file?).await? {
|
||||
|
Loading…
Reference in New Issue
Block a user