From b3085ea9e5a22776e5bbc9a948a7fbfdda8d3520 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 27 Jul 2024 15:22:08 +0200 Subject: [PATCH] vx demuxer: FPS belong to a different header field --- nihav-game/src/demuxers/vx.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nihav-game/src/demuxers/vx.rs b/nihav-game/src/demuxers/vx.rs index ac6b3e9..d6830c6 100644 --- a/nihav-game/src/demuxers/vx.rs +++ b/nihav-game/src/demuxers/vx.rs @@ -29,9 +29,10 @@ impl<'a> DemuxCore<'a> for VXDemuxer<'a> { let nframes = src.read_u32le()? as usize; let width = src.read_u32le()? as usize; let height = src.read_u32le()? as usize; - let _unk = src.read_u32le()? as usize; let fps = src.read_u32le()?; - validate!(fps > 0 && fps < 256); + validate!(fps > (1 << 16) && fps < (100 << 16)); + let quant = src.read_u32le()?; + validate!(quant > 0 && quant < 256); let srate = src.read_u32le()?; let num_audio_tracks = src.read_u32le()? as usize; let _max_frame_size = src.read_u32le()? as usize; @@ -46,9 +47,9 @@ impl<'a> DemuxCore<'a> for VXDemuxer<'a> { let vhdr = NAVideoInfo::new(width, height, false, YUV420_FORMAT); let vci = NACodecTypeInfo::Video(vhdr); - let edata = vec![fps as u8, 0, 0, 0]; + let edata = vec![quant as u8, 0, 0, 0]; let vinfo = NACodecInfo::new("vxvideo", vci, Some(edata)); - self.vid_id = strmgr.add_stream(NAStream::new(StreamType::Video, 0, vinfo, 1, fps, nframes as u64)).unwrap(); + self.vid_id = strmgr.add_stream(NAStream::new(StreamType::Video, 0, vinfo, 65536, fps, nframes as u64)).unwrap(); if num_audio_tracks != 0 { validate!(audio_off + ((num_audio_tracks * AUDIO_EXTRADATA_LEN) as u64) == vinfo_off); -- 2.39.5