From efdeae7da1e59cbf3d2b72ebd7d0951dd82bae20 Mon Sep 17 00:00:00 2001 From: Philip Deljanov Date: Sat, 5 Oct 2024 22:56:14 -0400 Subject: [PATCH] chore: Fix clippy warnings. --- symphonia-bundle-flac/Cargo.toml | 5 ++++- symphonia-bundle-mp3/src/common.rs | 4 ++++ symphonia-bundle-mp3/src/layer3/mod.rs | 6 +++--- symphonia-codec-vorbis/src/codebook.rs | 2 -- symphonia-core/src/io/media_source_stream.rs | 4 ++-- symphonia-core/src/io/mod.rs | 2 +- symphonia-core/src/io/scoped_stream.rs | 4 ++-- symphonia-format-caf/src/chunks.rs | 7 +++---- symphonia-format-isomp4/src/atoms/edts.rs | 1 + symphonia-format-isomp4/src/atoms/esds.rs | 2 ++ symphonia-format-isomp4/src/atoms/ftyp.rs | 1 + symphonia-format-isomp4/src/atoms/hdlr.rs | 1 + symphonia-format-isomp4/src/atoms/ilst.rs | 1 + symphonia-format-isomp4/src/atoms/mdhd.rs | 2 +- symphonia-format-isomp4/src/atoms/mdia.rs | 1 + symphonia-format-isomp4/src/atoms/mehd.rs | 1 + symphonia-format-isomp4/src/atoms/minf.rs | 1 + symphonia-format-isomp4/src/atoms/mod.rs | 3 ++- symphonia-format-isomp4/src/atoms/moov.rs | 1 + symphonia-format-isomp4/src/atoms/mvex.rs | 1 + symphonia-format-isomp4/src/atoms/mvhd.rs | 2 +- symphonia-format-isomp4/src/atoms/sidx.rs | 2 ++ symphonia-format-isomp4/src/atoms/smhd.rs | 1 + symphonia-format-isomp4/src/atoms/stsc.rs | 1 + symphonia-format-isomp4/src/atoms/stsd.rs | 1 + symphonia-format-isomp4/src/atoms/tfhd.rs | 1 + symphonia-format-isomp4/src/atoms/tkhd.rs | 1 + symphonia-format-isomp4/src/atoms/trak.rs | 1 + symphonia-format-isomp4/src/atoms/trex.rs | 1 + symphonia-format-isomp4/src/atoms/trun.rs | 1 + symphonia-format-mkv/src/ebml.rs | 1 + symphonia-format-ogg/Cargo.toml | 5 ++++- symphonia-format-ogg/src/page.rs | 1 + symphonia-format-riff/src/aiff/chunks.rs | 3 +++ symphonia-play/src/output.rs | 8 ++++---- symphonia/src/lib.rs | 2 +- 36 files changed, 58 insertions(+), 24 deletions(-) diff --git a/symphonia-bundle-flac/Cargo.toml b/symphonia-bundle-flac/Cargo.toml index f22b5b25..8f3060ab 100644 --- a/symphonia-bundle-flac/Cargo.toml +++ b/symphonia-bundle-flac/Cargo.toml @@ -16,4 +16,7 @@ rust-version = "1.53" log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } symphonia-metadata = { version = "0.5.4", path = "../symphonia-metadata" } -symphonia-utils-xiph = { version = "0.5.4", path = "../symphonia-utils-xiph" } \ No newline at end of file +symphonia-utils-xiph = { version = "0.5.4", path = "../symphonia-utils-xiph" } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } \ No newline at end of file diff --git a/symphonia-bundle-mp3/src/common.rs b/symphonia-bundle-mp3/src/common.rs index 6420f34f..976b7a1d 100644 --- a/symphonia-bundle-mp3/src/common.rs +++ b/symphonia-bundle-mp3/src/common.rs @@ -97,9 +97,13 @@ pub struct FrameHeader { pub sample_rate: u32, pub sample_rate_idx: usize, pub channel_mode: ChannelMode, + #[allow(dead_code)] pub emphasis: Emphasis, + #[allow(dead_code)] pub is_copyrighted: bool, + #[allow(dead_code)] pub is_original: bool, + #[allow(dead_code)] pub has_padding: bool, pub has_crc: bool, pub frame_size: usize, diff --git a/symphonia-bundle-mp3/src/layer3/mod.rs b/symphonia-bundle-mp3/src/layer3/mod.rs index d1257486..842229e3 100644 --- a/symphonia-bundle-mp3/src/layer3/mod.rs +++ b/symphonia-bundle-mp3/src/layer3/mod.rs @@ -154,11 +154,11 @@ struct GranuleChannel { /// per scale factor. /// /// - For MPEG1 bitstreams, `scalefac_compress` is a 4-bit index into - /// `SCALE_FACTOR_SLEN[0..16]` to obtain a number of bits per scale factor pair. + /// `SCALE_FACTOR_SLEN[0..16]` to obtain a number of bits per scale factor pair. /// /// - For MPEG2/2.5 bitstreams, `scalefac_compress` is a 9-bit value that decodes into - /// `slen[0..3]` (referred to as slen1-4 in the standard) for the number of bits per scale - /// factor, and depending on which range the value falls into, for which bands. + /// `slen[0..3]` (referred to as slen1-4 in the standard) for the number of bits per scale + /// factor, and depending on which range the value falls into, for which bands. scalefac_compress: u16, /// Indicates the block type (type of window) for the channel in the granule. block_type: BlockType, diff --git a/symphonia-codec-vorbis/src/codebook.rs b/symphonia-codec-vorbis/src/codebook.rs index daaaba82..7c1250c6 100644 --- a/symphonia-codec-vorbis/src/codebook.rs +++ b/symphonia-codec-vorbis/src/codebook.rs @@ -5,8 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -use std::usize; - use symphonia_core::errors::{decode_error, Result}; use symphonia_core::io::{ vlc::{BitOrder, Codebook, CodebookBuilder, Entry32x32}, diff --git a/symphonia-core/src/io/media_source_stream.rs b/symphonia-core/src/io/media_source_stream.rs index a5bbb234..fa6b8b9f 100644 --- a/symphonia-core/src/io/media_source_stream.rs +++ b/symphonia-core/src/io/media_source_stream.rs @@ -436,12 +436,12 @@ impl SeekBuffered for MediaSourceStream { // Forward seek. let delta = if pos > old_pos { - assert!(pos - old_pos < std::isize::MAX as u64); + assert!(pos - old_pos < isize::MAX as u64); (pos - old_pos) as isize } else if pos < old_pos { // Backward seek. - assert!(old_pos - pos < std::isize::MAX as u64); + assert!(old_pos - pos < isize::MAX as u64); -((old_pos - pos) as isize) } else { diff --git a/symphonia-core/src/io/mod.rs b/symphonia-core/src/io/mod.rs index e301cfcf..ea2aa9e4 100644 --- a/symphonia-core/src/io/mod.rs +++ b/symphonia-core/src/io/mod.rs @@ -475,7 +475,7 @@ pub trait SeekBuffered { /// This function is identical to [`SeekBuffered::seek_buffered_rel`] when a negative delta is /// provided. fn seek_buffered_rev(&mut self, delta: usize) { - assert!(delta < std::isize::MAX as usize); + assert!(delta < isize::MAX as usize); self.seek_buffered_rel(-(delta as isize)); } } diff --git a/symphonia-core/src/io/scoped_stream.rs b/symphonia-core/src/io/scoped_stream.rs index 12106062..1bc8c825 100644 --- a/symphonia-core/src/io/scoped_stream.rs +++ b/symphonia-core/src/io/scoped_stream.rs @@ -184,8 +184,8 @@ impl SeekBuffered for ScopedStream { fn seek_buffered_rel(&mut self, delta: isize) -> u64 { // Clamp the delta value such that the absolute position after the buffered seek will be // within the bounds of the ScopedStream. - let max_back = self.read.min(std::isize::MAX as u64) as isize; - let max_forward = (self.len - self.read).min(std::isize::MAX as u64) as isize; + let max_back = self.read.min(isize::MAX as u64) as isize; + let max_forward = (self.len - self.read).min(isize::MAX as u64) as isize; self.inner.seek_buffered_rel(delta.clamp(-max_back, max_forward)) } } diff --git a/symphonia-format-caf/src/chunks.rs b/symphonia-format-caf/src/chunks.rs index 733dbb15..7f4d29d6 100644 --- a/symphonia-format-caf/src/chunks.rs +++ b/symphonia-format-caf/src/chunks.rs @@ -66,10 +66,7 @@ impl Chunk { } other => { // Log unsupported chunk types but don't return an error - info!( - "unsupported chunk type ('{}')", - str::from_utf8(other.as_slice()).unwrap_or("????") - ); + info!("unsupported chunk type ('{}')", str::from_utf8(other).unwrap_or("????")); if chunk_size >= 0 { reader.ignore_bytes(chunk_size as u64)?; @@ -371,7 +368,9 @@ impl ChannelLayout { #[derive(Debug)] pub struct ChannelDescription { pub channel_label: u32, + #[allow(dead_code)] pub channel_flags: u32, + #[allow(dead_code)] pub coordinates: [f32; 3], } diff --git a/symphonia-format-isomp4/src/atoms/edts.rs b/symphonia-format-isomp4/src/atoms/edts.rs index 697b8d23..2c341646 100644 --- a/symphonia-format-isomp4/src/atoms/edts.rs +++ b/symphonia-format-isomp4/src/atoms/edts.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader, AtomIterator, AtomType, ElstAtom}; /// Edits atom. +#[allow(dead_code)] #[derive(Debug)] pub struct EdtsAtom { header: AtomHeader, diff --git a/symphonia-format-isomp4/src/atoms/esds.rs b/symphonia-format-isomp4/src/atoms/esds.rs index 19ba75b7..9a55130a 100644 --- a/symphonia-format-isomp4/src/atoms/esds.rs +++ b/symphonia-format-isomp4/src/atoms/esds.rs @@ -120,6 +120,7 @@ class ES_Descriptor extends BaseDescriptor : bit(8) tag=ES_DescrTag { } */ +#[allow(dead_code)] #[derive(Debug)] pub struct ESDescriptor { pub es_id: u16, @@ -202,6 +203,7 @@ class DecoderConfigDescriptor extends BaseDescriptor : bit(8) tag=DecoderConfigD } */ +#[allow(dead_code)] #[derive(Debug)] pub struct DecoderConfigDescriptor { pub codec_type: CodecType, diff --git a/symphonia-format-isomp4/src/atoms/ftyp.rs b/symphonia-format-isomp4/src/atoms/ftyp.rs index 0bdfcbf2..8dfb60e7 100644 --- a/symphonia-format-isomp4/src/atoms/ftyp.rs +++ b/symphonia-format-isomp4/src/atoms/ftyp.rs @@ -12,6 +12,7 @@ use crate::atoms::{Atom, AtomHeader}; use crate::fourcc::FourCc; /// File type atom. +#[allow(dead_code)] #[derive(Debug)] pub struct FtypAtom { header: AtomHeader, diff --git a/symphonia-format-isomp4/src/atoms/hdlr.rs b/symphonia-format-isomp4/src/atoms/hdlr.rs index 0d00a135..3cdffed7 100644 --- a/symphonia-format-isomp4/src/atoms/hdlr.rs +++ b/symphonia-format-isomp4/src/atoms/hdlr.rs @@ -33,6 +33,7 @@ pub enum HandlerType { } /// Handler atom. +#[allow(dead_code)] #[derive(Debug)] pub struct HdlrAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/ilst.rs b/symphonia-format-isomp4/src/atoms/ilst.rs index b75843b7..49a3a0fe 100644 --- a/symphonia-format-isomp4/src/atoms/ilst.rs +++ b/symphonia-format-isomp4/src/atoms/ilst.rs @@ -20,6 +20,7 @@ use encoding_rs::{SHIFT_JIS, UTF_16BE}; use log::warn; /// Data type enumeration for metadata value atoms as defined in the QuickTime File Format standard. +#[allow(dead_code)] #[derive(Debug, Copy, Clone)] pub enum DataType { AffineTransformF64, diff --git a/symphonia-format-isomp4/src/atoms/mdhd.rs b/symphonia-format-isomp4/src/atoms/mdhd.rs index 7d606bd0..cfbfee08 100644 --- a/symphonia-format-isomp4/src/atoms/mdhd.rs +++ b/symphonia-format-isomp4/src/atoms/mdhd.rs @@ -67,7 +67,7 @@ impl Atom for MdhdAtom { mdhd.timescale = reader.read_be_u32()?; // 0xffff_ffff is a special case. mdhd.duration = match reader.read_be_u32()? { - std::u32::MAX => std::u64::MAX, + u32::MAX => u64::MAX, duration => u64::from(duration), }; } diff --git a/symphonia-format-isomp4/src/atoms/mdia.rs b/symphonia-format-isomp4/src/atoms/mdia.rs index ef9c6a36..d19f9ccc 100644 --- a/symphonia-format-isomp4/src/atoms/mdia.rs +++ b/symphonia-format-isomp4/src/atoms/mdia.rs @@ -10,6 +10,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader, AtomIterator, AtomType, HdlrAtom, MdhdAtom, MinfAtom}; +#[allow(dead_code)] #[derive(Debug)] pub struct MdiaAtom { header: AtomHeader, diff --git a/symphonia-format-isomp4/src/atoms/mehd.rs b/symphonia-format-isomp4/src/atoms/mehd.rs index 192af11b..a7b5ef61 100644 --- a/symphonia-format-isomp4/src/atoms/mehd.rs +++ b/symphonia-format-isomp4/src/atoms/mehd.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader}; /// Movie extends header atom. +#[allow(dead_code)] #[derive(Debug)] pub struct MehdAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/minf.rs b/symphonia-format-isomp4/src/atoms/minf.rs index b280d982..ef010479 100644 --- a/symphonia-format-isomp4/src/atoms/minf.rs +++ b/symphonia-format-isomp4/src/atoms/minf.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader, AtomIterator, AtomType, SmhdAtom, StblAtom}; /// Media information atom. +#[allow(dead_code)] #[derive(Debug)] pub struct MinfAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/mod.rs b/symphonia-format-isomp4/src/atoms/mod.rs index d9a50c20..b23bd87f 100644 --- a/symphonia-format-isomp4/src/atoms/mod.rs +++ b/symphonia-format-isomp4/src/atoms/mod.rs @@ -373,6 +373,7 @@ impl AtomHeader { } pub trait Atom: Sized { + #[allow(dead_code)] fn header(&self) -> AtomHeader; fn read(reader: &mut B, header: AtomHeader) -> Result; @@ -442,7 +443,7 @@ impl AtomIterator { // An atom with a length of zero is defined to span to the end of the stream. If // len is available, use it for the next atom start position, otherwise, use u64 max // which will trip an end of stream error on the next iteration. - self.len.map(|l| self.base_pos + l).unwrap_or(std::u64::MAX) + self.len.map(|l| self.base_pos + l).unwrap_or(u64::MAX) } len => self.next_atom_pos + len, diff --git a/symphonia-format-isomp4/src/atoms/moov.rs b/symphonia-format-isomp4/src/atoms/moov.rs index a6898429..f7f3001c 100644 --- a/symphonia-format-isomp4/src/atoms/moov.rs +++ b/symphonia-format-isomp4/src/atoms/moov.rs @@ -16,6 +16,7 @@ use crate::atoms::{ use log::warn; /// Movie atom. +#[allow(dead_code)] #[derive(Debug)] pub struct MoovAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/mvex.rs b/symphonia-format-isomp4/src/atoms/mvex.rs index 2af84423..c0fec4fd 100644 --- a/symphonia-format-isomp4/src/atoms/mvex.rs +++ b/symphonia-format-isomp4/src/atoms/mvex.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader, AtomIterator, AtomType, MehdAtom, TrexAtom}; /// Movie extends atom. +#[allow(dead_code)] #[derive(Debug)] pub struct MvexAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/mvhd.rs b/symphonia-format-isomp4/src/atoms/mvhd.rs index 14521db2..a7d8b7cc 100644 --- a/symphonia-format-isomp4/src/atoms/mvhd.rs +++ b/symphonia-format-isomp4/src/atoms/mvhd.rs @@ -53,7 +53,7 @@ impl Atom for MvhdAtom { mvhd.timescale = reader.read_be_u32()?; // 0xffff_ffff is a special case. mvhd.duration = match reader.read_be_u32()? { - std::u32::MAX => std::u64::MAX, + u32::MAX => u64::MAX, duration => u64::from(duration), }; } diff --git a/symphonia-format-isomp4/src/atoms/sidx.rs b/symphonia-format-isomp4/src/atoms/sidx.rs index 40433a9c..917a54d8 100644 --- a/symphonia-format-isomp4/src/atoms/sidx.rs +++ b/symphonia-format-isomp4/src/atoms/sidx.rs @@ -16,6 +16,7 @@ pub enum ReferenceType { Media, } +#[allow(dead_code)] #[derive(Debug)] pub struct SidxReference { pub reference_type: ReferenceType, @@ -27,6 +28,7 @@ pub struct SidxReference { } /// Segment index atom. +#[allow(dead_code)] #[derive(Debug)] pub struct SidxAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/smhd.rs b/symphonia-format-isomp4/src/atoms/smhd.rs index 670fe9a8..6fac4cb6 100644 --- a/symphonia-format-isomp4/src/atoms/smhd.rs +++ b/symphonia-format-isomp4/src/atoms/smhd.rs @@ -12,6 +12,7 @@ use crate::atoms::{Atom, AtomHeader}; use crate::fp::FpI8; /// Sound header atom. +#[allow(dead_code)] #[derive(Debug)] pub struct SmhdAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/stsc.rs b/symphonia-format-isomp4/src/atoms/stsc.rs index ded81d4d..e8950163 100644 --- a/symphonia-format-isomp4/src/atoms/stsc.rs +++ b/symphonia-format-isomp4/src/atoms/stsc.rs @@ -10,6 +10,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader}; +#[allow(dead_code)] #[derive(Debug)] pub struct StscEntry { pub first_chunk: u32, diff --git a/symphonia-format-isomp4/src/atoms/stsd.rs b/symphonia-format-isomp4/src/atoms/stsd.rs index 841718ad..53e2c818 100644 --- a/symphonia-format-isomp4/src/atoms/stsd.rs +++ b/symphonia-format-isomp4/src/atoms/stsd.rs @@ -145,6 +145,7 @@ pub enum AudioCodecSpecific { Pcm(Pcm), } +#[allow(dead_code)] #[derive(Debug)] pub struct AudioSampleEntry { pub num_channels: u32, diff --git a/symphonia-format-isomp4/src/atoms/tfhd.rs b/symphonia-format-isomp4/src/atoms/tfhd.rs index 3221a1da..7acb87d2 100644 --- a/symphonia-format-isomp4/src/atoms/tfhd.rs +++ b/symphonia-format-isomp4/src/atoms/tfhd.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader}; /// Track fragment header atom. +#[allow(dead_code)] #[derive(Debug)] pub struct TfhdAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/tkhd.rs b/symphonia-format-isomp4/src/atoms/tkhd.rs index 3b3d899b..17c28718 100644 --- a/symphonia-format-isomp4/src/atoms/tkhd.rs +++ b/symphonia-format-isomp4/src/atoms/tkhd.rs @@ -12,6 +12,7 @@ use crate::atoms::{Atom, AtomHeader}; use crate::fp::FpU8; /// Track header atom. +#[allow(dead_code)] #[derive(Debug)] pub struct TkhdAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/trak.rs b/symphonia-format-isomp4/src/atoms/trak.rs index 920fb3ed..55115925 100644 --- a/symphonia-format-isomp4/src/atoms/trak.rs +++ b/symphonia-format-isomp4/src/atoms/trak.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader, AtomIterator, AtomType, EdtsAtom, MdiaAtom, TkhdAtom}; /// Track atom. +#[allow(dead_code)] #[derive(Debug)] pub struct TrakAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/trex.rs b/symphonia-format-isomp4/src/atoms/trex.rs index ec72948f..23a1ce60 100644 --- a/symphonia-format-isomp4/src/atoms/trex.rs +++ b/symphonia-format-isomp4/src/atoms/trex.rs @@ -11,6 +11,7 @@ use symphonia_core::io::ReadBytes; use crate::atoms::{Atom, AtomHeader}; /// Track extends atom. +#[allow(dead_code)] #[derive(Debug)] pub struct TrexAtom { /// Atom header. diff --git a/symphonia-format-isomp4/src/atoms/trun.rs b/symphonia-format-isomp4/src/atoms/trun.rs index b0db6e34..25757743 100644 --- a/symphonia-format-isomp4/src/atoms/trun.rs +++ b/symphonia-format-isomp4/src/atoms/trun.rs @@ -12,6 +12,7 @@ use symphonia_core::util::bits; use crate::atoms::{Atom, AtomHeader}; /// Track fragment run atom. +#[allow(dead_code)] #[derive(Debug)] pub struct TrunAtom { /// Atom header. diff --git a/symphonia-format-mkv/src/ebml.rs b/symphonia-format-mkv/src/ebml.rs index e814831c..f488f47a 100644 --- a/symphonia-format-mkv/src/ebml.rs +++ b/symphonia-format-mkv/src/ebml.rs @@ -508,6 +508,7 @@ impl ElementIterator { } /// An EBML element data. +#[allow(dead_code)] #[derive(Clone, Debug)] pub(crate) enum ElementData { /// A binary buffer. diff --git a/symphonia-format-ogg/Cargo.toml b/symphonia-format-ogg/Cargo.toml index 1a326203..9cfc5f12 100644 --- a/symphonia-format-ogg/Cargo.toml +++ b/symphonia-format-ogg/Cargo.toml @@ -16,4 +16,7 @@ rust-version = "1.53" log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } symphonia-metadata = { version = "0.5.4", path = "../symphonia-metadata" } -symphonia-utils-xiph = { version = "0.5.4", path = "../symphonia-utils-xiph" } \ No newline at end of file +symphonia-utils-xiph = { version = "0.5.4", path = "../symphonia-utils-xiph" } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } \ No newline at end of file diff --git a/symphonia-format-ogg/src/page.rs b/symphonia-format-ogg/src/page.rs index 271fa648..02d1bdeb 100644 --- a/symphonia-format-ogg/src/page.rs +++ b/symphonia-format-ogg/src/page.rs @@ -18,6 +18,7 @@ pub const OGG_PAGE_MAX_SIZE: usize = OGG_PAGE_HEADER_SIZE + 255 + 255 * 255; #[derive(Copy, Clone, Default)] pub struct PageHeader { + #[allow(dead_code)] pub version: u8, pub absgp: u64, pub serial: u32, diff --git a/symphonia-format-riff/src/aiff/chunks.rs b/symphonia-format-riff/src/aiff/chunks.rs index da377c0d..860f4ad4 100644 --- a/symphonia-format-riff/src/aiff/chunks.rs +++ b/symphonia-format-riff/src/aiff/chunks.rs @@ -27,6 +27,7 @@ pub struct CommonChunk { /// The number of channels. pub n_channels: i16, /// The number of audio frames. + #[allow(dead_code)] pub n_sample_frames: u32, /// The sample size in bits. pub sample_size: i16, @@ -251,7 +252,9 @@ impl CommonChunkParser for ChunkParser { /// `SoundChunk` is a required AIFF chunk, containing the audio data. pub struct SoundChunk { pub len: u32, + #[allow(dead_code)] pub offset: u32, + #[allow(dead_code)] pub block_size: u32, } diff --git a/symphonia-play/src/output.rs b/symphonia-play/src/output.rs index e5445438..1e1476f2 100644 --- a/symphonia-play/src/output.rs +++ b/symphonia-play/src/output.rs @@ -66,11 +66,11 @@ mod pulseaudio { // attributes for very short audio streams. // // let pa_buf_attr = pulse::def::BufferAttr { - // maxlength: std::u32::MAX, + // maxlength: u32::MAX, // tlength: 1024, - // prebuf: std::u32::MAX, - // minreq: std::u32::MAX, - // fragsize: std::u32::MAX, + // prebuf: u32::MAX, + // minreq: u32::MAX, + // fragsize: u32::MAX, // }; // Create a PulseAudio connection. diff --git a/symphonia/src/lib.rs b/symphonia/src/lib.rs index e16fddfe..d2eb4339 100644 --- a/symphonia/src/lib.rs +++ b/symphonia/src/lib.rs @@ -98,7 +98,7 @@ //! 4. Instantiate a [`MediaSourceStream`][core::io::MediaSourceStream] with the `MediaSource` //! above. //! 5. Using the `Probe`, call [`format`][core::probe::Probe::format] and pass it the -//! `MediaSourceStream`. +//! `MediaSourceStream`. //! 6. If the probe successfully detects a compatible format, a `FormatReader` will be returned. //! This is an instance of a demuxer that can read and demux the provided source into //! [`Packet`][core::formats::Packet]s.