claxondec: Fix/silence a few clippy warnings

This commit is contained in:
Sebastian Dröge 2020-01-20 08:13:43 +02:00
parent 1ad4e39cc9
commit 5047ed480d

View file

@ -146,23 +146,21 @@ impl AudioDecoderImpl for ClaxonDec {
if inmap[0..7] != [0x7f, b'F', b'L', b'A', b'C', 0x01, 0x00] { if inmap[0..7] != [0x7f, b'F', b'L', b'A', b'C', 0x01, 0x00] {
gst_debug!(self.cat, obj: element, "Unknown streamheader format"); gst_debug!(self.cat, obj: element, "Unknown streamheader format");
} else { } else if let Ok(tstreaminfo) = get_claxon_streaminfo(&inmap[13..]) {
if let Ok(tstreaminfo) = get_claxon_streaminfo(&inmap[13..]) { if let Ok(taudio_info) = get_gstaudioinfo(tstreaminfo) {
if let Ok(taudio_info) = get_gstaudioinfo(tstreaminfo) { // To speed up negotiation
// To speed up negotiation if element.set_output_format(&taudio_info).is_err()
if element.set_output_format(&taudio_info).is_err() || element.negotiate().is_err()
|| element.negotiate().is_err() {
{ gst_debug!(
gst_debug!( self.cat,
self.cat, obj: element,
obj: element, "Error to negotiate output from based on in-caps streaminfo"
"Error to negotiate output from based on in-caps streaminfo" );
);
}
audio_info = Some(taudio_info);
streaminfo = Some(tstreaminfo);
} }
audio_info = Some(taudio_info);
streaminfo = Some(tstreaminfo);
} }
} }
} }
@ -178,6 +176,7 @@ impl AudioDecoderImpl for ClaxonDec {
Ok(()) Ok(())
} }
#[allow(clippy::verbose_bit_mask)]
fn handle_frame( fn handle_frame(
&self, &self,
element: &gst_audio::AudioDecoder, element: &gst_audio::AudioDecoder,
@ -309,8 +308,8 @@ impl ClaxonDec {
let mut v: Vec<i32> = vec![0; result.len() as usize]; let mut v: Vec<i32> = vec![0; result.len() as usize];
for (o, i) in v.chunks_exact_mut(channels).enumerate() { for (o, i) in v.chunks_exact_mut(channels).enumerate() {
for c in 0..channels { for (c, s) in i.iter_mut().enumerate() {
i[c] = result.sample(c as u32, o as u32); *s = result.sample(c as u32, o as u32);
} }
} }
v v