]> git.nihav.org Git - nihav.git/commitdiff
mov: do not overwrite timebase with sample rate
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 30 Jun 2023 16:11:11 +0000 (18:11 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 30 Jun 2023 16:11:11 +0000 (18:11 +0200)
E.g. in AAC SBR case we may get timebase 2048/44100 with the nominal
sample rate being 22050 Hz.

nihav-commonfmt/src/demuxers/mov.rs

index f57b1c7a5869c9d10db84eacf6e613ee8b678e61..54a6c522d2f1a9c86cd90a9e70894248e9c6562a 100644 (file)
@@ -754,7 +754,9 @@ fn read_stsd(track: &mut Track, br: &mut ByteReader, size: u64) -> DemuxerResult
                     track.bsize = (sample_size / 8) as usize;
                 },
             };
-            track.tb_den = sample_rate;
+            if track.tb_den <= 1 {
+                track.tb_den = sample_rate;
+            }
             track.raw_audio = matches!(&fcc,
                     b"NONE" | b"raw " | b"twos" | b"sowt" |
                     b"in24" | b"in32" | b"fl32" | b"fl64" |