mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 02:26:35 +00:00
uriplaylistbin: prevent deadlock when notifying property changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1232>
This commit is contained in:
parent
780d9d5b78
commit
97fa20237f
1 changed files with 15 additions and 1 deletions
|
@ -1681,12 +1681,26 @@ impl UriPlaylistBin {
|
|||
}
|
||||
|
||||
let element = self.obj();
|
||||
let mut notify_iteration = false;
|
||||
let mut notify_index = false;
|
||||
|
||||
if current_iteration != state.current_iteration {
|
||||
state.current_iteration = current_iteration;
|
||||
element.notify("current-iteration");
|
||||
notify_iteration = true;
|
||||
}
|
||||
if current_uri_index != state.current_uri_index {
|
||||
state.current_uri_index = current_uri_index;
|
||||
notify_index = true;
|
||||
}
|
||||
|
||||
// drop mutex before notifying changes as the callback will likely try to fetch the updated values
|
||||
// which would deadlock.
|
||||
drop(state_guard);
|
||||
|
||||
if notify_iteration {
|
||||
element.notify("current-iteration");
|
||||
}
|
||||
if notify_index {
|
||||
element.notify("current-uri-index");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue