mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
bin: Don't keep the object lock while setting a GstContext when handling NEED_CONTEXT
This can potentially deadlock. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3707 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7310>
This commit is contained in:
parent
8aa5a9520c
commit
14e3be6a26
1 changed files with 8 additions and 3 deletions
|
@ -3985,13 +3985,17 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
|
|||
}
|
||||
case GST_MESSAGE_NEED_CONTEXT:{
|
||||
const gchar *context_type;
|
||||
GList *l, *contexts;
|
||||
|
||||
gst_message_parse_context_type (message, &context_type);
|
||||
|
||||
if (src) {
|
||||
GList *l, *contexts;
|
||||
|
||||
GST_OBJECT_LOCK (bin);
|
||||
contexts = GST_ELEMENT_CAST (bin)->contexts;
|
||||
contexts =
|
||||
g_list_copy_deep (GST_ELEMENT_CAST (bin)->contexts,
|
||||
(GCopyFunc) gst_mini_object_ref, NULL);
|
||||
GST_OBJECT_UNLOCK (bin);
|
||||
GST_LOG_OBJECT (bin, "got need-context message type: %s", context_type);
|
||||
for (l = contexts; l; l = l->next) {
|
||||
GstContext *tmp = l->data;
|
||||
|
@ -4002,7 +4006,8 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
|
|||
break;
|
||||
}
|
||||
}
|
||||
GST_OBJECT_UNLOCK (bin);
|
||||
|
||||
g_list_free_full (contexts, (GDestroyNotify) gst_mini_object_unref);
|
||||
|
||||
/* Forward if we couldn't answer the message */
|
||||
if (l == NULL) {
|
||||
|
|
Loading…
Reference in a new issue