From 418df65e14707270566bb2a499d3633dacef249a Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 23 Nov 2021 11:26:10 +0100 Subject: [PATCH] mpegaudio: handle VBRI tag in packetiser as well --- nihav-mpeg/src/codecs/mpegaudio/mod.rs | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.39.5