From: Kostya Shishkov Date: Mon, 5 Feb 2024 17:52:05 +0000 (+0100) Subject: mov: fix seeking in audio track with unreported sample size X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=c6432d30823e5b5372e74290b34bf89af6ece52f;p=nihav.git mov: fix seeking in audio track with unreported sample size --- diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index 87eb2f1..a8d0dfd 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -1481,7 +1481,9 @@ impl Track { self.samples_left = csamp - self.cur_sample; self.cur_chunk += 1; } - } else if self.chunk_offsets.len() == self.chunk_sizes.len() { + } else if self.chunk_offsets.len() == self.chunk_sizes.len() && self.duration != 0 { + let new_sample = (self.chunk_sizes.len() as u64 * exp_pts / u64::from(self.duration)) as usize; + self.cur_sample = new_sample; self.cur_chunk = self.cur_sample; } else { if !self.time_to_sample.is_empty() {