From 2da5d6e4f7730b44b3ba28d671efc0634504f44e Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 28 Jul 2024 16:17:48 +0200 Subject: [PATCH] vx demuxer: set keyframe flags --- nihav-game/src/demuxers/vx.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5