diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2024-07-27 15:22:08 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2024-07-27 15:22:08 +0200 |
commit | b3085ea9e5a22776e5bbc9a948a7fbfdda8d3520 (patch) | |
tree | a5b62da4f2007b93cbb29a82c5fe945560d46bca | |
parent | 052916931074c25049cd329468f391da371ea7e5 (diff) | |
download | nihav-b3085ea9e5a22776e5bbc9a948a7fbfdda8d3520.tar.gz |
vx demuxer: FPS belong to a different header field
-rw-r--r-- | nihav-game/src/demuxers/vx.rs | 9 |
1 files 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); |