From: Kostya Shishkov Date: Tue, 23 Nov 2021 10:26:10 +0000 (+0100) Subject: mpegaudio: handle VBRI tag in packetiser as well X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=418df65e14707270566bb2a499d3633dacef249a;p=nihav.git mpegaudio: handle VBRI tag in packetiser as well --- diff --git a/nihav-mpeg/src/codecs/mpegaudio/mod.rs b/nihav-mpeg/src/codecs/mpegaudio/mod.rs index 187a695..0f44e89 100644 --- a/nihav-mpeg/src/codecs/mpegaudio/mod.rs +++ b/nihav-mpeg/src/codecs/mpegaudio/mod.rs @@ -376,6 +376,8 @@ impl NAPacketiser for MPAPacketiser { if (flags & 1) != 0 { duration = u64::from(read_u32be(&self.buf[offset + 8..]).unwrap_or(0)); } + } else if self.buf.len() >= offset + 18 && &self.buf[offset..][..6] == b"VBRI\x00\x01" { + duration = u64::from(read_u32be(&self.buf[offset + 14..]).unwrap_or(0)); } } let ainfo = NAAudioInfo::new(hdr.srate, hdr.channels, SND_F32P_FORMAT, hdr.nsamples);