From e6d3ab3d736acb67b8a386184666200484cc74fa Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 5 Nov 2022 11:09:16 +0100 Subject: [PATCH] siff: fix SON duration --- nihav-game/src/demuxers/siff.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nihav-game/src/demuxers/siff.rs b/nihav-game/src/demuxers/siff.rs index 7bc29fc..1c961be 100644 --- a/nihav-game/src/demuxers/siff.rs +++ b/nihav-game/src/demuxers/siff.rs @@ -204,7 +204,7 @@ impl<'a> SIFFDemuxer<'a> { validate!(&tag == b"SHDR"); let hdr_size = self.src.read_u32be()? as usize; validate!(hdr_size >= 8); - let snd_size = self.src.read_u32le()?; + let duration = self.src.read_u32le()? as u64; let srate = self.src.read_u16le()? as u32; let flags = self.src.read_u16le()?; let bits = flags as u8; @@ -213,8 +213,6 @@ impl<'a> SIFFDemuxer<'a> { self.ablock = (bits as usize) * (channels as usize); self.src.read_skip(hdr_size - 8)?; - let duration = u64::from(snd_size) / u64::from(channels) * 8 / u64::from(bits); - let fmt = match bits { 8 => SND_U8_FORMAT, 16 => SND_S16_FORMAT, -- 2.39.5