From: Kostya Shishkov Date: Sun, 13 Dec 2020 13:10:06 +0000 (+0100) Subject: mov: fix track duration rescaling X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=15395de63e3c784e0e4d21de655efa991643e33d;p=nihav.git mov: fix track duration rescaling --- 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);