diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-11-04 18:25:56 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-11-04 18:25:56 +0100 |
commit | 8e14efb001fac3fecb0cb56df8705d23fa2231a8 (patch) | |
tree | bdd21683de1db9d4c39d0d68cf8e180e7ea902cb /nihav-commonfmt | |
parent | 3867d436b51515207e0035e2c6cb127de3935c57 (diff) | |
download | nihav-8e14efb001fac3fecb0cb56df8705d23fa2231a8.tar.gz |
switch demuxers to use NAStream::make_ts()
Diffstat (limited to 'nihav-commonfmt')
-rw-r--r-- | nihav-commonfmt/src/demuxers/avi.rs | 4 | ||||
-rw-r--r-- | nihav-commonfmt/src/demuxers/y4m.rs | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index dc8ea6b..cd33c51 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -184,8 +184,8 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> { } continue; } - let (tb_num, tb_den) = stream.get_timebase(); - let mut ts = NATimeInfo::new(Some(self.cur_frame[stream_no as usize]), None, None, tb_num, tb_den); + 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" { ts.pts = None; } diff --git a/nihav-commonfmt/src/demuxers/y4m.rs b/nihav-commonfmt/src/demuxers/y4m.rs index 05157ca..9340421 100644 --- a/nihav-commonfmt/src/demuxers/y4m.rs +++ b/nihav-commonfmt/src/demuxers/y4m.rs @@ -37,8 +37,7 @@ impl<'a> DemuxCore<'a> for Y4MDemuxer<'a> { }; validate!(&marker == b"FRAME\n"); let stream = strmgr.get_stream(0).unwrap(); - let (tb_num, tb_den) = stream.get_timebase(); - let ts = NATimeInfo::new(Some(self.frameno), None, None, tb_num, tb_den); + let ts = stream.make_ts(Some(self.frameno), None, None); let pkt = self.src.read_packet(stream, ts, true, self.frame_size)?; self.frameno += 1; Ok(pkt) |