From e9c93f5f087a52d9f5c14c5f3bb821038f1b211d Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 16 Apr 2020 13:32:39 +0200 Subject: [PATCH] add option for not stopping on the first decoding error --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.30.2