projects
/
nihav-tool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7437145
)
add option for not stopping on the first decoding error
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Thu, 16 Apr 2020 11:32:39 +0000
(13:32 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Thu, 16 Apr 2020 11:32:39 +0000
(13:32 +0200)
src/main.rs
patch
|
blob
|
blame
|
history
diff --git
a/src/main.rs
b/src/main.rs
index ff6baac91cea84ed7bf3dc46c6ae0465fc5eaf70..bb94c1218432969bcebead768e75deb3fbaa6b68 100644
(file)
--- 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 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() {
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());
},
}
vpfx = Some(args[cur_arg].clone());
},
+ "-ignerr" => { ignore_errors = true; },
_ => { println!("unknown option {}", args[cur_arg]); return; },
}
cur_arg += 1;
_ => { 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);
},
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; }
},
};
if pkt.get_pts() != None && lastpts.is_some() && pkt.get_pts() >= lastpts { break; }