mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +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();
|
||||
element.add_pad(&pad).unwrap();
|
||||
|
||||
let mut notify_active_pad = false;
|
||||
if state.active_sinkpad.is_none() {
|
||||
state.active_sinkpad = Some(pad.clone());
|
||||
state.switched_pad = true;
|
||||
state.discont_pending = true;
|
||||
element.notify(PROP_ACTIVE_PAD);
|
||||
notify_active_pad = true;
|
||||
}
|
||||
|
||||
let mut pad_settings = pad.imp().settings.lock();
|
||||
|
@ -1248,6 +1249,10 @@ impl ElementImpl for FallbackSwitch {
|
|||
drop(pad_settings);
|
||||
drop(state);
|
||||
|
||||
if notify_active_pad {
|
||||
element.notify(PROP_ACTIVE_PAD);
|
||||
}
|
||||
|
||||
let _ = element.post_message(gst::message::Latency::builder().src(element).build());
|
||||
|
||||
element.child_added(&pad, &pad.name());
|
||||
|
|
Loading…
Reference in a new issue