From fd2c4eb5d5d2152acd3e894d15fd1544468c7940 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 18 Aug 2025 18:31:36 +0200 Subject: [PATCH] nihav_mpeg: switch to ByteIO --- nihav-mpeg/src/codecs/aac/mod.rs | 3 +-- nihav-mpeg/src/codecs/mpeg4asp/bitstream.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/nihav-mpeg/src/codecs/aac/mod.rs b/nihav-mpeg/src/codecs/aac/mod.rs index d0588e3..5adbc07 100644 --- a/nihav-mpeg/src/codecs/aac/mod.rs +++ b/nihav-mpeg/src/codecs/aac/mod.rs @@ -681,8 +681,7 @@ impl NADecoder for AACDecoder { validate!(edata.len() >= 2); if (edata.len() > 12) && (&edata[4..8] == b"esds") { - let mut mr = MemoryReader::new_read(edata.as_slice()); - let mut br = ByteReader::new(&mut mr); + let mut br = MemoryReader::new_read(edata.as_slice()); let esds_size = br.read_u32be()? as usize; validate!(esds_size <= edata.len()); br.read_skip(8)?; diff --git a/nihav-mpeg/src/codecs/mpeg4asp/bitstream.rs b/nihav-mpeg/src/codecs/mpeg4asp/bitstream.rs index ac3f79b..8d91973 100644 --- a/nihav-mpeg/src/codecs/mpeg4asp/bitstream.rs +++ b/nihav-mpeg/src/codecs/mpeg4asp/bitstream.rs @@ -33,8 +33,7 @@ impl<'a> ReadMarkerBit for BitReader<'a> { } pub fn scan_start_codes(src: &[u8]) -> DecoderResult> { - let mut mr = MemoryReader::new_read(src); - let mut br = ByteReader::new(&mut mr); + let mut br = MemoryReader::new_read(src); let mut offs = Vec::new(); let mut pfx = br.read_u32be()?; -- 2.39.5