From: Kostya Shishkov Date: Sun, 28 Jul 2024 14:17:48 +0000 (+0200) Subject: vx demuxer: set keyframe flags X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=2da5d6e4f7730b44b3ba28d671efc0634504f44e;p=nihav.git vx demuxer: set keyframe flags --- diff --git a/nihav-game/src/demuxers/vx.rs b/nihav-game/src/demuxers/vx.rs index 4a47298..b3128a8 100644 --- a/nihav-game/src/demuxers/vx.rs +++ b/nihav-game/src/demuxers/vx.rs @@ -100,7 +100,9 @@ impl<'a> DemuxCore<'a> for VXDemuxer<'a> { let mut buf = vec![0; fsize + 4]; write_u32le(&mut buf, (fsize * 8) as u32)?; self.src.read_buf(&mut buf[4..])?; - let pkt = NAPacket::new(stream, ts, false, buf); + let keyframe = self.vno == 0 || + self.seektab.binary_search_by_key(&self.vno, |&(frm, _)| u64::from(frm)).is_ok(); + let pkt = NAPacket::new(stream, ts, keyframe, buf); self.video_pos = self.src.tell(); self.vno += 1; Ok(pkt)