aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-04-16 13:32:39 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-04-16 13:32:39 +0200
commite9c93f5f087a52d9f5c14c5f3bb821038f1b211d (patch)
tree0ca134d8ca2b47b39069a97f653528f9e77c69e1
parent7437145d254f1852f5b594e56e20124761bb5b02 (diff)
downloadnihav-tool-e9c93f5f087a52d9f5c14c5f3bb821038f1b211d.tar.gz
add option for not stopping on the first decoding error
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index ff6baac..bb94c12 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -94,6 +94,7 @@ fn main() {
let mut seek_time = 0u64;
let mut vpfx: Option<String> = None;
let mut apfx: Option<&str> = None;
+ let mut ignore_errors = false;
while (cur_arg < args.len()) && args[cur_arg].starts_with('-') {
match args[cur_arg].as_str() {
@@ -133,6 +134,7 @@ fn main() {
}
vpfx = Some(args[cur_arg].clone());
},
+ "-ignerr" => { ignore_errors = true; },
_ => { println!("unknown option {}", args[cur_arg]); return; },
}
cur_arg += 1;
@@ -256,7 +258,9 @@ panic!("decoder {} not found", info.get_name());
},
Err(reason) => {
println!("error decoding frame {:?}", reason);
- break;
+ if !ignore_errors {
+ break;
+ }
},
};
if pkt.get_pts() != None && lastpts.is_some() && pkt.get_pts() >= lastpts { break; }