Skip to content

Commit

Permalink
Simplify !parsed_done err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Jun 28, 2024
1 parent 6c3087c commit c5f4300
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vmaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub fn run(
let mut vmaf = vmaf;
let mut chunks = Chunks::default();
let mut parsed_done = false;
let mut exit_ok = false;
while let Some(next) = vmaf.next().await {
match next {
Item::Stderr(chunk) => {
Expand All @@ -50,13 +49,14 @@ pub fn run(
}
}
Item::Stdout(_) => {}
Item::Done(code) => match exit_ok_stderr("ffmpeg vmaf", code, &cmd_str, &chunks) {
Ok(_) => exit_ok = true,
Err(err) => yield VmafOut::Err(err),
},
Item::Done(code) => {
if let Err(err) = exit_ok_stderr("ffmpeg vmaf", code, &cmd_str, &chunks) {
yield VmafOut::Err(err);
}
}
}
}
if exit_ok && !parsed_done {
if !parsed_done {
yield VmafOut::Err(cmd_err(
"could not parse ffmpeg vmaf score",
&cmd_str,
Expand Down

0 comments on commit c5f4300

Please sign in to comment.