diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-12-13 12:43:16 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-12-13 12:43:16 +0300 |
commit | 3f904553ea1336fc73333ec680493c41250a03fe (patch) | |
tree | ea270ea2f9b5484fc729a4a174ea2a0261e89f9a /audio/audiofx | |
parent | 289e8a08c31610fbf62056f8a156eb647e9c3a2a (diff) |
Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1011>
Diffstat (limited to 'audio/audiofx')
-rw-r--r-- | audio/audiofx/src/audioecho/ring_buffer.rs | 4 | ||||
-rw-r--r-- | audio/audiofx/src/audioloudnorm/imp.rs | 9 | ||||
-rw-r--r-- | audio/audiofx/src/hrtfrender/imp.rs | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/audio/audiofx/src/audioecho/ring_buffer.rs b/audio/audiofx/src/audioecho/ring_buffer.rs index aa6417e5..7e811744 100644 --- a/audio/audiofx/src/audioecho/ring_buffer.rs +++ b/audio/audiofx/src/audioecho/ring_buffer.rs @@ -15,8 +15,8 @@ pub struct RingBuffer { impl RingBuffer { pub fn new(size: usize) -> Self { - let mut buffer = Vec::with_capacity(size as usize); - buffer.extend(iter::repeat(0.0).take(size as usize)); + let mut buffer = Vec::with_capacity(size); + buffer.extend(iter::repeat(0.0).take(size)); Self { buffer: buffer.into_boxed_slice(), diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index 915e5cb0..d6740171 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -611,10 +611,9 @@ impl State { // the position where we have to start writing the next 100ms in the next // iteration. - let mut outbuf = gst::Buffer::with_size( - self.current_samples_per_frame as usize * self.info.bpf() as usize, - ) - .map_err(|_| gst::FlowError::Error)?; + let mut outbuf = + gst::Buffer::with_size(self.current_samples_per_frame * self.info.bpf() as usize) + .map_err(|_| gst::FlowError::Error)?; { let outbuf = outbuf.get_mut().unwrap(); let mut dst = outbuf.map_writable().map_err(|_| gst::FlowError::Error)?; @@ -819,7 +818,7 @@ impl State { // adjustment. frame_type should only ever be set to Final at the end if we ended up in // Inner state before. if self.frame_type == FrameType::First - && (src.len() / self.info.channels() as usize) < self.current_samples_per_frame as usize + && (src.len() / self.info.channels() as usize) < self.current_samples_per_frame { self.process_first_frame_is_last(imp)?; } diff --git a/audio/audiofx/src/hrtfrender/imp.rs b/audio/audiofx/src/hrtfrender/imp.rs index 97fc6a0c..06d49689 100644 --- a/audio/audiofx/src/hrtfrender/imp.rs +++ b/audio/audiofx/src/hrtfrender/imp.rs @@ -373,7 +373,7 @@ impl HrtfRender { let (prev_offset, _) = state.adapter.prev_offset(); let offset = prev_offset.checked_add(distance_samples).unwrap_or(0); - let duration_samples = outputsz / outbpf as usize; + let duration_samples = outputsz / outbpf; let duration = samples_to_time(duration_samples as u64); (pts, offset, duration) |