mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 03:21:00 +00:00
Remove unnecessary mut
everywhere
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1273>
This commit is contained in:
parent
c2201480cf
commit
bbd3d9ffe0
8 changed files with 16 additions and 16 deletions
|
@ -132,7 +132,7 @@ impl AudioDecoderImpl for LewtonDec {
|
|||
reorder_map: None,
|
||||
});
|
||||
|
||||
let mut state = state_guard.as_mut().unwrap();
|
||||
let state = state_guard.as_mut().unwrap();
|
||||
|
||||
let s = caps.structure(0).unwrap();
|
||||
if let Ok(Some(streamheaders)) = s.get_optional::<gst::ArrayRef>("streamheader") {
|
||||
|
|
|
@ -2943,7 +2943,7 @@ impl BaseWebRTCSink {
|
|||
}
|
||||
|
||||
let mut state = element.imp().state.lock().unwrap();
|
||||
if let Some(mut stream) = state.streams.get_mut(&name) {
|
||||
if let Some(stream) = state.streams.get_mut(&name) {
|
||||
stream.out_caps = Some(payloader_caps.clone());
|
||||
}
|
||||
|
||||
|
@ -2997,7 +2997,7 @@ impl BaseWebRTCSink {
|
|||
.unwrap()
|
||||
.streams
|
||||
.iter_mut()
|
||||
.for_each(|(_, mut stream)| {
|
||||
.for_each(|(_, stream)| {
|
||||
if stream.sink_pad.upcast_ref::<gst::Pad>() == pad {
|
||||
stream.in_caps = Some(e.caps().to_owned());
|
||||
}
|
||||
|
|
|
@ -507,7 +507,7 @@ impl JsonGstParse {
|
|||
fn loop_fn(&self) {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let State { ref mut pull, .. } = *state;
|
||||
let mut pull = pull.as_mut().unwrap();
|
||||
let pull = pull.as_mut().unwrap();
|
||||
let offset = pull.offset;
|
||||
let scan_duration = pull.duration.is_none();
|
||||
|
||||
|
@ -519,7 +519,7 @@ impl JsonGstParse {
|
|||
match self.scan_duration() {
|
||||
Ok(pts) => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let mut pull = state.pull.as_mut().unwrap();
|
||||
let pull = state.pull.as_mut().unwrap();
|
||||
pull.duration = pts;
|
||||
}
|
||||
Err(err) => {
|
||||
|
@ -596,7 +596,7 @@ impl JsonGstParse {
|
|||
self.handle_buffer(Some(buffer))
|
||||
}
|
||||
|
||||
fn flush(&self, mut state: &mut State) {
|
||||
fn flush(&self, state: &mut State) {
|
||||
state.reader.clear();
|
||||
if let Some(pull) = &mut state.pull {
|
||||
pull.offset = 0;
|
||||
|
|
|
@ -1441,7 +1441,7 @@ impl FallbackSrc {
|
|||
None => return,
|
||||
};
|
||||
|
||||
let mut source = if fallback_source {
|
||||
let source = if fallback_source {
|
||||
if let Some(ref mut source) = state.fallback_source {
|
||||
source
|
||||
} else {
|
||||
|
|
|
@ -205,7 +205,7 @@ impl State {
|
|||
|
||||
/* Collect cues, fixing up their duration based on the next cue */
|
||||
while let Some(lines) = self.pending.front() {
|
||||
if let Some(mut drained_line) = drained_lines.back_mut() {
|
||||
if let Some(drained_line) = drained_lines.back_mut() {
|
||||
drained_line.duration = lines.pts - drained_line.pts;
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ impl State {
|
|||
}
|
||||
|
||||
/* cues that end a fragment must be clipped and cloned for the next fragment */
|
||||
if let Some(mut drained_line) = drained_lines.back_mut() {
|
||||
if let Some(drained_line) = drained_lines.back_mut() {
|
||||
/* Clip to either the requested PTS, or segment stop if specified */
|
||||
let end_pts = if running_time.is_none() {
|
||||
self.last_pts.unwrap()
|
||||
|
|
|
@ -725,7 +725,7 @@ impl MccParse {
|
|||
ref mut pull,
|
||||
..
|
||||
} = *state;
|
||||
let mut pull = pull.as_mut().unwrap();
|
||||
let pull = pull.as_mut().unwrap();
|
||||
let scan_tc_rate = tc_rate.is_none() && pull.duration.is_none();
|
||||
let offset = pull.offset;
|
||||
|
||||
|
@ -763,12 +763,12 @@ impl MccParse {
|
|||
match self.scan_duration() {
|
||||
Ok(Some(tc)) => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let mut pull = state.pull.as_mut().unwrap();
|
||||
let pull = state.pull.as_mut().unwrap();
|
||||
pull.duration = Some(tc.time_since_daily_jam());
|
||||
}
|
||||
Ok(None) => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let mut pull = state.pull.as_mut().unwrap();
|
||||
let pull = state.pull.as_mut().unwrap();
|
||||
pull.duration = Some(gst::ClockTime::ZERO);
|
||||
}
|
||||
Err(err) => {
|
||||
|
|
|
@ -625,7 +625,7 @@ impl SccParse {
|
|||
ref mut pull,
|
||||
..
|
||||
} = *state;
|
||||
let mut pull = pull.as_mut().unwrap();
|
||||
let pull = pull.as_mut().unwrap();
|
||||
let scan_duration = framerate.is_none() && pull.duration.is_none();
|
||||
let offset = pull.offset;
|
||||
|
||||
|
@ -662,12 +662,12 @@ impl SccParse {
|
|||
match self.scan_duration() {
|
||||
Ok(Some(tc)) => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let mut pull = state.pull.as_mut().unwrap();
|
||||
let pull = state.pull.as_mut().unwrap();
|
||||
pull.duration = Some(tc.time_since_daily_jam());
|
||||
}
|
||||
Ok(None) => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let mut pull = state.pull.as_mut().unwrap();
|
||||
let pull = state.pull.as_mut().unwrap();
|
||||
pull.duration = Some(gst::ClockTime::ZERO);
|
||||
}
|
||||
Err(err) => {
|
||||
|
|
|
@ -488,7 +488,7 @@ impl TtToCea608 {
|
|||
|
||||
fn generate(
|
||||
&self,
|
||||
mut state: &mut State,
|
||||
state: &mut State,
|
||||
settings: &Settings,
|
||||
pts: gst::ClockTime,
|
||||
duration: gst::ClockTime,
|
||||
|
|
Loading…
Reference in a new issue