mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
Revert "element: set pads need-parent flag to false when removing"
This reverts commit 1911554cff
.
This breaks the functionality of GST_PAD_FLAG_NEED_PARENT, the reason for this
flag is that if a pad is removed from a running element, you don't want
functions (such as chain or event) to be called on the pad without a parent set.
This can happen if you remove a request or sometimes pad from a running element.
I don't see the code that caused this in tsdemux, but if it needs to unset
the flag on remove, it should do it itself and then make sure that the parent
exists in any pad function.
This commit is contained in:
parent
0ee2183aa5
commit
f9baff11c8
2 changed files with 0 additions and 36 deletions
|
@ -795,7 +795,6 @@ gst_element_remove_pad (GstElement * element, GstPad * pad)
|
|||
break;
|
||||
}
|
||||
element->pads = g_list_remove (element->pads, pad);
|
||||
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_PARENT);
|
||||
element->numpads--;
|
||||
element->pads_cookie++;
|
||||
GST_OBJECT_UNLOCK (element);
|
||||
|
|
|
@ -50,40 +50,6 @@ GST_START_TEST (test_add_remove_pad)
|
|||
|
||||
GST_END_TEST;
|
||||
|
||||
|
||||
GST_START_TEST (test_add_remove_readd_pad)
|
||||
{
|
||||
GstElement *e;
|
||||
GstPad *p;
|
||||
|
||||
/* getting an existing element class is cheating, but easier */
|
||||
e = gst_element_factory_make ("fakesrc", "source");
|
||||
|
||||
/* create a new floating pad with refcount 1 */
|
||||
p = gst_pad_new ("source", GST_PAD_SRC);
|
||||
|
||||
gst_object_ref (p);
|
||||
|
||||
/* simulate a real scenario where the pad is activated before added */
|
||||
fail_unless (gst_pad_set_active (p, TRUE));
|
||||
gst_element_add_pad (e, p);
|
||||
|
||||
/* now remove and deactivate it */
|
||||
fail_unless (gst_pad_set_active (p, FALSE));
|
||||
gst_element_remove_pad (e, p);
|
||||
|
||||
/* should be able to reuse the same pad */
|
||||
fail_unless (gst_pad_set_active (p, TRUE));
|
||||
fail_unless (gst_element_add_pad (e, p));
|
||||
|
||||
/* clean up our own reference */
|
||||
gst_object_unref (p);
|
||||
gst_object_unref (e);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
|
||||
GST_START_TEST (test_add_pad_unref_element)
|
||||
{
|
||||
GstElement *e;
|
||||
|
@ -389,7 +355,6 @@ gst_element_suite (void)
|
|||
|
||||
suite_add_tcase (s, tc_chain);
|
||||
tcase_add_test (tc_chain, test_add_remove_pad);
|
||||
tcase_add_test (tc_chain, test_add_remove_readd_pad);
|
||||
tcase_add_test (tc_chain, test_add_pad_unref_element);
|
||||
tcase_add_test (tc_chain, test_error_no_bus);
|
||||
tcase_add_test (tc_chain, test_link);
|
||||
|
|
Loading…
Reference in a new issue