dec_video: care about PTS only in the decoded stream
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 30 Oct 2019 17:34:55 +0000 (18:34 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 30 Oct 2019 17:34:55 +0000 (18:34 +0100)
nihav-core/src/test/dec_video.rs

index dfefdc4826b64b38490a474f31d2d2d15b391019..da29429c297b318ff2b77281f496e9ef6abee0c7 100644 (file)
@@ -182,11 +182,11 @@ pub fn test_file_decoding(demuxer: &str, name: &str, limit: Option<u64>,
             panic!("error");
         }
         let pkt = pktres.unwrap();
-        if let (Some(lim), Some(ppts)) = (limit, pkt.get_pts()) {
-            if ppts > lim { break; }
-        }
         let streamno = pkt.get_stream().get_id() as usize;
         if let Some((ref mut dsupp, ref mut dec)) = decs[streamno] {
+            if let (Some(lim), Some(ppts)) = (limit, pkt.get_pts()) {
+                if ppts > lim { break; }
+            }
             let frm = dec.decode(dsupp, &pkt).unwrap();
             if pkt.get_stream().get_info().is_video() && video_pfx.is_some() && frm.get_frame_type() != FrameType::Skip {
                 let pfx = video_pfx.unwrap();