From f88b8fb4f64962205372892b782ad0ae09034e9a Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 12 Jul 2020 10:40:39 +0200 Subject: [PATCH] skip packets before start point --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.5