]> git.nihav.org Git - nihav.git/commitdiff
mov: do not rescale track timestamps if the timebase is already an expected one
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 14 Nov 2026 09:54:58 +0000 (10:54 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 14 Nov 2026 09:54:58 +0000 (10:54 +0100)
Otherwise audio files that report timebase as packet_duration/samplerate
will rescale it by packet_duration again.

nihav-commonfmt/src/demuxers/mov/track.rs

index 90aecfbc0a94d5c4d7485169bda5e7579c7c3d0d..9ebcb3a0c2c755619d97181e24103eab9905962a 100644 (file)
@@ -1057,6 +1057,7 @@ impl Track {
         self.read_traf(br, size)
     }
     fn rescale(&mut self, tb_num: u32) {
+        if self.tb_num == tb_num { return; }
         self.tb_div = tb_num;
         for stream in self.streams.iter_mut() {
             let tb_den = stream.tb_den;