From: Kostya Shishkov Date: Sat, 5 Nov 2022 10:09:16 +0000 (+0100) Subject: siff: fix SON duration X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=e6d3ab3d736acb67b8a386184666200484cc74fa;p=nihav.git siff: fix SON duration --- 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,