]> git.nihav.org Git - nihav-encoder.git/commitdiff
skip packets before start point
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 12 Jul 2020 08:40:39 +0000 (10:40 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 12 Jul 2020 08:40:39 +0000 (10:40 +0200)
src/main.rs

index 38de7771b02bdbb9bd4f4d62c47716e0aa15e7d6..a6d464aed1dfdd47f8ef2d133d7fb33ebb04f860 100644 (file)
@@ -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;