mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 11:30:59 +00:00
fallbackswitch: Only notify active-pad property on state changes if it actually changed
This commit is contained in:
parent
452ea76a69
commit
96c28a5728
1 changed files with 9 additions and 6 deletions
|
@ -1140,18 +1140,21 @@ impl ElementImpl for FallbackSwitch {
|
|||
}
|
||||
gst::StateChange::ReadyToPaused => {
|
||||
let mut state = self.state.lock();
|
||||
let prev_active_pad = state.active_sinkpad.clone();
|
||||
*state = State::default();
|
||||
let pads = element.sink_pads();
|
||||
|
||||
if let Some(pad) = pads.first() {
|
||||
state.active_sinkpad = Some(
|
||||
pad.clone()
|
||||
.downcast::<super::FallbackSwitchSinkPad>()
|
||||
.unwrap(),
|
||||
);
|
||||
let pad = pad.downcast_ref::<super::FallbackSwitchSinkPad>().unwrap();
|
||||
|
||||
state.active_sinkpad = Some(pad.clone());
|
||||
state.switched_pad = true;
|
||||
state.discont_pending = true;
|
||||
drop(state);
|
||||
element.notify(PROP_ACTIVE_PAD);
|
||||
|
||||
if prev_active_pad.as_ref() != Some(pad) {
|
||||
element.notify(PROP_ACTIVE_PAD);
|
||||
}
|
||||
}
|
||||
for pad in pads {
|
||||
let pad = pad.downcast_ref::<super::FallbackSwitchSinkPad>().unwrap();
|
||||
|
|
Loading…
Reference in a new issue