From e82678586f5a12ceea83d5aee5519a6de3591a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 13 Apr 2022 14:26:16 +0300 Subject: [PATCH] fallbackswitch: Remove a redundant pad state unlock/lock --- utils/fallbackswitch/src/fallbackswitch/imp.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 9d106342..b2ae1278 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -696,12 +696,11 @@ impl FallbackSwitch { state }; - let pad_state = pad_imp.state.lock(); + let mut pad_state = pad_imp.state.lock(); if pad_state.flushing { debug!(CAT, obj: element, "Flushing"); return Err(gst::FlowError::Flushing); } - drop(pad_state); let is_active = state.active_sinkpad.as_ref() == Some(pad); let switched_pad = state.switched_pad; @@ -753,7 +752,6 @@ impl FallbackSwitch { state.discont_pending = false; } - let mut pad_state = pad_imp.state.lock(); if let Some(running_time) = end_running_time { pad_state.current_running_time = Some(running_time); }