diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-11-05 11:09:16 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-11-05 11:09:16 +0100 |
commit | e6d3ab3d736acb67b8a386184666200484cc74fa (patch) | |
tree | af6bfb3783d4ec1dfcf9edfb60792fb61c3072af | |
parent | 9fce24c89edfe18da71acf4a44ffca03b1575fe6 (diff) | |
download | nihav-e6d3ab3d736acb67b8a386184666200484cc74fa.tar.gz |
siff: fix SON duration
-rw-r--r-- | nihav-game/src/demuxers/siff.rs | 4 |
1 files changed, 1 insertions, 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, |