From: Kostya Shishkov Date: Tue, 14 Apr 2026 19:10:47 +0000 (+0200) Subject: mov: when inventing keyframes intra-only mode should take priority X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;ds=sidebyside;p=nihav.git mov: when inventing keyframes intra-only mode should take priority --- diff --git a/nihav-commonfmt/src/demuxers/mov/pktread.rs b/nihav-commonfmt/src/demuxers/mov/pktread.rs index 2185664..5ec9889 100644 --- a/nihav-commonfmt/src/demuxers/mov/pktread.rs +++ b/nihav-commonfmt/src/demuxers/mov/pktread.rs @@ -181,17 +181,17 @@ impl QTPacketDemuxer { } pub fn invent_keyframes(&mut self, intraonly: bool) { self.keyframes.reserve(self.time_to_sample.len()); - if self.time_to_sample.len() > 2 { + if intraonly && !self.chunk_sizes.is_empty() { + for samp in 0..self.chunk_sizes.len() { + self.keyframes.push((samp + 1) as u32); + } + } else if self.time_to_sample.len() > 2 { let mut abs_csamp = 1u64; for &(count, _scount) in self.time_to_sample.iter() { let count = u64::from(count); self.keyframes.push(abs_csamp as u32); abs_csamp += count; } - } else if intraonly && !self.chunk_sizes.is_empty() { - for samp in 0..self.chunk_sizes.len() { - self.keyframes.push((samp + 1) as u32); - } } else { let max_nsamps = self.sample_map.iter().fold(0u32, |mns, &(_sno, ns)| mns.max(ns)); if max_nsamps >= 3 {