From 15395de63e3c784e0e4d21de655efa991643e33d Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 13 Dec 2020 14:10:06 +0100 Subject: [PATCH] mov: fix track duration rescaling --- nihav-commonfmt/src/demuxers/mov.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index 4d36c05..ac124fa 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -701,11 +701,12 @@ fn read_stts(track: &mut Track, br: &mut ByteReader, size: u64) -> DemuxerResult if let Some(ref mut stream) = track.stream { let tb_den = stream.tb_den; let (tb_num, tb_den) = reduce_timebase(tb_num * stream.tb_num, tb_den); - stream.duration /= u64::from(stream.tb_den / tb_den); + stream.duration /= u64::from(track.tb_div); stream.tb_num = tb_num; stream.tb_den = tb_den; track.tb_num = tb_num; track.tb_den = tb_den; + track.duration /= track.tb_div; } } else { track.time_to_sample.truncate(0); -- 2.39.5