]> git.nihav.org Git - nihav.git/commitdiff
avi: leave first PCM timestamp for time calculation
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 17 Mar 2025 17:20:36 +0000 (18:20 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 17 Mar 2025 17:20:36 +0000 (18:20 +0100)
nihav-commonfmt/src/demuxers/avi.rs

index c0f54b47aba50814b3089972a865364777e6e3cf..c0ccc335d53122e9c2a7360e9d80af86e70c6e1c 100644 (file)
@@ -185,7 +185,7 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> {
             }
             let (tb_num, _) = stream.get_timebase();
             let mut ts = stream.make_ts(Some(self.cur_frame[stream_no as usize]), None, None);
-            if stream.get_media_type() == StreamType::Audio && tb_num == 1 && stream.get_info().get_name() == "pcm" {
+            if stream.get_media_type() == StreamType::Audio && tb_num == 1 && stream.get_info().get_name() == "pcm" && ts.pts != Some(0) {
                 ts.pts = None;
             }
             let mut pkt = self.src.read_packet(stream, ts, is_keyframe, size)?;