fallbackswitch: Remove a redundant pad state unlock/lock

This commit is contained in:
Sebastian Dröge 2022-04-13 14:26:16 +03:00 committed by Sebastian Dröge
parent 279dd7d053
commit e82678586f

View file

@ -696,12 +696,11 @@ impl FallbackSwitch {
state state
}; };
let pad_state = pad_imp.state.lock(); let mut pad_state = pad_imp.state.lock();
if pad_state.flushing { if pad_state.flushing {
debug!(CAT, obj: element, "Flushing"); debug!(CAT, obj: element, "Flushing");
return Err(gst::FlowError::Flushing); return Err(gst::FlowError::Flushing);
} }
drop(pad_state);
let is_active = state.active_sinkpad.as_ref() == Some(pad); let is_active = state.active_sinkpad.as_ref() == Some(pad);
let switched_pad = state.switched_pad; let switched_pad = state.switched_pad;
@ -753,7 +752,6 @@ impl FallbackSwitch {
state.discont_pending = false; state.discont_pending = false;
} }
let mut pad_state = pad_imp.state.lock();
if let Some(running_time) = end_running_time { if let Some(running_time) = end_running_time {
pad_state.current_running_time = Some(running_time); pad_state.current_running_time = Some(running_time);
} }