From de3f3f006ff7b0b6407111d4dca3ec124be398fb Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 30 Jun 2023 18:11:11 +0200 Subject: [PATCH] mov: do not overwrite timebase with sample rate 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index f57b1c7..54a6c52 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -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" | -- 2.39.5