]> git.nihav.org Git - nihav.git/commitdiff
avi: do not set PTS for raw PCM with 1/rate timebase
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 6 Apr 2021 16:52:38 +0000 (18:52 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 6 Apr 2021 16:52:38 +0000 (18:52 +0200)
nihav-commonfmt/src/demuxers/avi.rs

index d99bfc965b016b9807b58c64b053a679113b9785..9adf54b55d5c3261c3915802b080e4fff71c689c 100644 (file)
@@ -120,7 +120,10 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> {
                 continue;
             }
             let (tb_num, tb_den) = stream.get_timebase();
-            let ts = NATimeInfo::new(Some(self.cur_frame[stream_no as usize]), None, None, tb_num, tb_den);
+            let mut ts = NATimeInfo::new(Some(self.cur_frame[stream_no as usize]), None, None, tb_num, tb_den);
+            if stream.get_media_type() == StreamType::Audio && tb_num == 1 && stream.get_info().get_name() == "pcm" {
+                ts.pts = None;
+            }
             let mut pkt = self.src.read_packet(stream, ts, is_keyframe, size)?;
             for pe in self.pal.iter_mut() {
                 if pe.stream_no == (stream_no as usize) {