diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2024-07-28 16:17:48 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2024-07-28 16:17:48 +0200 |
commit | 2da5d6e4f7730b44b3ba28d671efc0634504f44e (patch) | |
tree | 3f1764032ece967b80d0825b1a25af323504bf2e /nihav-game/src | |
parent | 6abff179ae3058d41de917738e52a1d42295e0e0 (diff) | |
download | nihav-2da5d6e4f7730b44b3ba28d671efc0634504f44e.tar.gz |
vx demuxer: set keyframe flags
Diffstat (limited to 'nihav-game/src')
-rw-r--r-- | nihav-game/src/demuxers/vx.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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) |