From: Kostya Shishkov Date: Sun, 12 Jul 2020 08:40:39 +0000 (+0200) Subject: skip packets before start point X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=f88b8fb4f64962205372892b782ad0ae09034e9a;p=nihav-encoder.git skip packets before start point --- diff --git a/src/main.rs b/src/main.rs index 38de777..a6d464a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -919,6 +919,7 @@ println!("stream {} - {} {}", i, s, info.get_name()); break; } let mut pkt = pktres.unwrap(); + if transcoder.start != NATimePoint::None && pkt.ts.less_than(transcoder.start) { continue; } let src_id = pkt.get_stream().get_num(); match transcoder.encoders[src_id] { OutputMode::Drop => {}, @@ -934,6 +935,9 @@ println!("stream {} - {} {}", i, s, info.get_name()); OutputMode::Encode(dst_id, ref mut encoder, ref mut cvt) => { if let Some((ref mut dsupp, ref mut decoder)) = transcoder.decoders[src_id] { let ret = decoder.decode(dsupp, &pkt); + if let (true, Err(DecoderError::MissingReference)) = (transcoder.start != NATimePoint::None, &ret) { + continue; + } if ret.is_err() { println!("error decoding stream {}", src_id); break;