From bdab55f6a3aa52ee11b1b6f91dc8c4edf1da9c1b Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 6 Apr 2021 18:52:38 +0200 Subject: [PATCH] avi: do not set PTS for raw PCM with 1/rate timebase --- nihav-commonfmt/src/demuxers/avi.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index d99bfc9..9adf54b 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -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) { -- 2.39.5