mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 13:31:00 +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,19 +1140,22 @@ impl ElementImpl for FallbackSwitch {
|
||||||
}
|
}
|
||||||
gst::StateChange::ReadyToPaused => {
|
gst::StateChange::ReadyToPaused => {
|
||||||
let mut state = self.state.lock();
|
let mut state = self.state.lock();
|
||||||
|
let prev_active_pad = state.active_sinkpad.clone();
|
||||||
*state = State::default();
|
*state = State::default();
|
||||||
let pads = element.sink_pads();
|
let pads = element.sink_pads();
|
||||||
|
|
||||||
if let Some(pad) = pads.first() {
|
if let Some(pad) = pads.first() {
|
||||||
state.active_sinkpad = Some(
|
let pad = pad.downcast_ref::<super::FallbackSwitchSinkPad>().unwrap();
|
||||||
pad.clone()
|
|
||||||
.downcast::<super::FallbackSwitchSinkPad>()
|
state.active_sinkpad = Some(pad.clone());
|
||||||
.unwrap(),
|
|
||||||
);
|
|
||||||
state.switched_pad = true;
|
state.switched_pad = true;
|
||||||
state.discont_pending = true;
|
state.discont_pending = true;
|
||||||
drop(state);
|
drop(state);
|
||||||
|
|
||||||
|
if prev_active_pad.as_ref() != Some(pad) {
|
||||||
element.notify(PROP_ACTIVE_PAD);
|
element.notify(PROP_ACTIVE_PAD);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for pad in pads {
|
for pad in pads {
|
||||||
let pad = pad.downcast_ref::<super::FallbackSwitchSinkPad>().unwrap();
|
let pad = pad.downcast_ref::<super::FallbackSwitchSinkPad>().unwrap();
|
||||||
let pad_imp = pad.imp();
|
let pad_imp = pad.imp();
|
||||||
|
|
Loading…
Reference in a new issue