mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +00:00
autoconvert: Fix race condition when creating sub elements
There was a case where the element would get destroyed while being added to the hash table of elements Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6989>
This commit is contained in:
parent
c14a2d7d6d
commit
11f96ce4dd
1 changed files with 5 additions and 4 deletions
|
@ -500,13 +500,12 @@ gst_base_auto_convert_add_element (GstBaseAutoConvert * self,
|
|||
|
||||
g_assert (filter_info->subbin);
|
||||
|
||||
|
||||
element = filter_info->subbin;
|
||||
element = gst_object_ref (filter_info->subbin);
|
||||
GST_DEBUG_OBJECT (self, "Adding element %s to the baseautoconvert bin",
|
||||
filter_info->name);
|
||||
|
||||
pads = internal_pads_new (self, GST_OBJECT_NAME (element));
|
||||
g_hash_table_insert (self->elements, element, pads);
|
||||
g_hash_table_insert (self->elements, element, internal_pads_ref (pads));
|
||||
|
||||
gst_pad_set_chain_function (pads->sink,
|
||||
GST_DEBUG_FUNCPTR (gst_base_auto_convert_internal_sink_chain));
|
||||
|
@ -522,7 +521,9 @@ gst_base_auto_convert_add_element (GstBaseAutoConvert * self,
|
|||
gst_pad_set_query_function (pads->src,
|
||||
GST_DEBUG_FUNCPTR (gst_base_auto_convert_internal_src_query));
|
||||
|
||||
return gst_object_ref (element);
|
||||
internal_pads_unref (pads);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
static GstElement *
|
||||
|
|
Loading…
Reference in a new issue