From: Kostya Shishkov Date: Tue, 6 Apr 2021 16:52:38 +0000 (+0200) Subject: avi: do not set PTS for raw PCM with 1/rate timebase X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=bdab55f6a3aa52ee11b1b6f91dc8c4edf1da9c1b;p=nihav.git avi: do not set PTS for raw PCM with 1/rate timebase --- 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) {