From: Kostya Shishkov Date: Sat, 27 Jul 2024 13:22:08 +0000 (+0200) Subject: vx demuxer: FPS belong to a different header field X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=b3085ea9e5a22776e5bbc9a948a7fbfdda8d3520;p=nihav.git vx demuxer: FPS belong to a different header field --- 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);