aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2024-02-05 18:52:05 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2024-02-05 18:52:05 +0100
commitc6432d30823e5b5372e74290b34bf89af6ece52f (patch)
tree2bda18096a3d30b5d99c337e892ade79d09009a8
parent84082d37c8019fbac7009e4d09668eb04058dfb0 (diff)
downloadnihav-c6432d30823e5b5372e74290b34bf89af6ece52f.tar.gz
mov: fix seeking in audio track with unreported sample size
-rw-r--r--nihav-commonfmt/src/demuxers/mov.rs4
1 files changed, 3 insertions, 1 deletions
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() {