let mut decode_video = true;
let mut decode_audio = true;
let mut nmode = NumberMode::FrmPTS;
+ let mut seek_time = 0u64;
while (cur_arg < args.len()) && args[cur_arg].starts_with('-') {
match args[cur_arg].as_str() {
"-nm=count" => { nmode = NumberMode::Counter; },
"-nm=pktpts" => { nmode = NumberMode::PktPTS; },
"-nm=frmpts" => { nmode = NumberMode::FrmPTS; },
+ "-seek" => {
+ cur_arg += 1;
+ if cur_arg == args.len() {
+ println!("seek time missing");
+ return;
+ }
+ let ret = args[cur_arg].parse::<u64>();
+ if ret.is_err() {
+ println!("wrong seek time");
+ return;
+ }
+ seek_time = ret.unwrap();
+ },
_ => { println!("unknown option {}", args[cur_arg]); return; },
}
cur_arg += 1;
br.seek(SeekFrom::Start(0)).unwrap();
let mut dmx = create_demuxer(dmx_fact, &mut br).unwrap();
+ if seek_time > 0 {
+ let ret = dmx.seek(seek_time);
+ if ret.is_err() {
+println!(" seek error {:?}", ret.err().unwrap());
+ }
+ }
+
let mut decs: Vec<Option<(Box<NADecoderSupport>, Box<dyn NADecoder>)>> = Vec::new();
let mut sids: Vec<u32> = Vec::new();
let mut writers: Vec<Outputter> = Vec::new();