mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-07 08:49:21 +00:00
Fix/silence some clippy warnings
This commit is contained in:
parent
8370fb8a11
commit
5435ea1b7c
|
@ -1072,7 +1072,14 @@ impl State {
|
|||
|
||||
// Gain reduction at the new start. Note the plus as the slope is
|
||||
// negative already here.
|
||||
self.gain_reduction[0] = self.gain_reduction[0] + new_start * old_slope;
|
||||
//
|
||||
// Clippy warning ignored here because this is just incidentally the same as
|
||||
// AssignAdd: we calculate a new adjusted gain reduction here, and override the
|
||||
// previous one.
|
||||
#[allow(clippy::assign_op_pattern)]
|
||||
{
|
||||
self.gain_reduction[0] = self.gain_reduction[0] + new_start * old_slope;
|
||||
}
|
||||
|
||||
// At env_cnt == ATTACK_WINDOW we need the new gain reduction
|
||||
self.gain_reduction[1] = gain_reduction;
|
||||
|
|
|
@ -138,23 +138,29 @@ fn run_test(
|
|||
let mut num_samples = 0;
|
||||
let mut expected_ts = gst::ClockTime::from(0);
|
||||
for sample in samples.iter() {
|
||||
use std::cmp::Ordering;
|
||||
|
||||
let buf = sample.get_buffer().unwrap();
|
||||
|
||||
let ts = buf.get_pts();
|
||||
if ts > expected_ts {
|
||||
assert!(
|
||||
ts - expected_ts <= gst::ClockTime::from(1),
|
||||
"TS is {} instead of {}",
|
||||
ts,
|
||||
expected_ts
|
||||
);
|
||||
} else if ts < expected_ts {
|
||||
assert!(
|
||||
expected_ts - ts <= gst::ClockTime::from(1),
|
||||
"TS is {} instead of {}",
|
||||
ts,
|
||||
expected_ts
|
||||
);
|
||||
match ts.cmp(&expected_ts) {
|
||||
Ordering::Greater => {
|
||||
assert!(
|
||||
ts - expected_ts <= gst::ClockTime::from(1),
|
||||
"TS is {} instead of {}",
|
||||
ts,
|
||||
expected_ts
|
||||
);
|
||||
}
|
||||
Ordering::Less => {
|
||||
assert!(
|
||||
expected_ts - ts <= gst::ClockTime::from(1),
|
||||
"TS is {} instead of {}",
|
||||
ts,
|
||||
expected_ts
|
||||
);
|
||||
}
|
||||
Ordering::Equal => (),
|
||||
}
|
||||
|
||||
let map = buf.map_readable().unwrap();
|
||||
|
|
|
@ -403,10 +403,11 @@ impl Transcriber {
|
|||
"AWS raised an error: {}",
|
||||
message.message
|
||||
);
|
||||
Err(gst_error_msg!(
|
||||
|
||||
return Err(gst_error_msg!(
|
||||
gst::StreamError::Failed,
|
||||
["AWS raised an error: {}", message.message]
|
||||
))?;
|
||||
));
|
||||
}
|
||||
|
||||
let mut transcript: Transcript =
|
||||
|
|
Loading…
Reference in a new issue