From: Kostya Shishkov Date: Thu, 16 Apr 2020 11:32:39 +0000 (+0200) Subject: add option for not stopping on the first decoding error X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=e9c93f5f087a52d9f5c14c5f3bb821038f1b211d;p=nihav-tool.git add option for not stopping on the first decoding error --- 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 = 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; }