]> git.nihav.org Git - nihav.git/commitdiff
[test] use frame PTS instead of packet when available
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 18 Aug 2018 12:14:07 +0000 (14:14 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 1 Sep 2018 09:28:39 +0000 (11:28 +0200)
src/test/dec_video.rs

index e192fd4cd2fc087274ae67e443e4d7611e159f9b..61577c43e97d171aa2243bf6a5d4c714523ef103 100644 (file)
@@ -143,10 +143,11 @@ pub fn test_file_decoding(demuxer: &str, name: &str, limit: Option<u64>,
             let frm = dec.decode(&pkt).unwrap();
             if pkt.get_stream().get_info().is_video() && video_pfx.is_some() && frm.borrow().get_frame_type() != FrameType::Skip {
                 let pfx = video_pfx.unwrap();
+               let pts = if let Some(fpts) = frm.borrow().get_pts() { fpts } else { pkt.get_pts().unwrap() };
                 if frm.borrow().get_buffer().get_vbuf().unwrap().get_info().get_format().is_paletted() {
-                    write_palppm(pfx, streamno, pkt.get_pts().unwrap(), frm);
+                    write_palppm(pfx, streamno, pts, frm);
                 } else {
-                    write_pgmyuv(pfx, streamno, pkt.get_pts().unwrap(), frm);
+                    write_pgmyuv(pfx, streamno, pts, frm);
                 }
             }
         }