From 0366d374da0082f9bef8e49104b7f1631b24e9c1 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 18 Aug 2018 14:14:07 +0200 Subject: [PATCH] [test] use frame PTS instead of packet when available --- src/test/dec_video.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/dec_video.rs b/src/test/dec_video.rs index e192fd4..61577c4 100644 --- a/src/test/dec_video.rs +++ b/src/test/dec_video.rs @@ -143,10 +143,11 @@ pub fn test_file_decoding(demuxer: &str, name: &str, limit: Option, 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); } } } -- 2.39.5