mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 11:30:59 +00:00
fallbackswitch: Notify active-pad without state lock held
Can otherwise deadlock.
This commit is contained in:
parent
b5a3a99825
commit
0ba6ebb10f
1 changed files with 6 additions and 1 deletions
|
@ -1236,11 +1236,12 @@ impl ElementImpl for FallbackSwitch {
|
||||||
pad.set_active(true).unwrap();
|
pad.set_active(true).unwrap();
|
||||||
element.add_pad(&pad).unwrap();
|
element.add_pad(&pad).unwrap();
|
||||||
|
|
||||||
|
let mut notify_active_pad = false;
|
||||||
if state.active_sinkpad.is_none() {
|
if state.active_sinkpad.is_none() {
|
||||||
state.active_sinkpad = Some(pad.clone());
|
state.active_sinkpad = Some(pad.clone());
|
||||||
state.switched_pad = true;
|
state.switched_pad = true;
|
||||||
state.discont_pending = true;
|
state.discont_pending = true;
|
||||||
element.notify(PROP_ACTIVE_PAD);
|
notify_active_pad = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut pad_settings = pad.imp().settings.lock();
|
let mut pad_settings = pad.imp().settings.lock();
|
||||||
|
@ -1248,6 +1249,10 @@ impl ElementImpl for FallbackSwitch {
|
||||||
drop(pad_settings);
|
drop(pad_settings);
|
||||||
drop(state);
|
drop(state);
|
||||||
|
|
||||||
|
if notify_active_pad {
|
||||||
|
element.notify(PROP_ACTIVE_PAD);
|
||||||
|
}
|
||||||
|
|
||||||
let _ = element.post_message(gst::message::Latency::builder().src(element).build());
|
let _ = element.post_message(gst::message::Latency::builder().src(element).build());
|
||||||
|
|
||||||
element.child_added(&pad, &pad.name());
|
element.child_added(&pad, &pad.name());
|
||||||
|
|
Loading…
Reference in a new issue