gst/gstutils.c: Ensure that we set a capsfilter to NULL if we failed to link it when doing filtered linking, to avoid...

Original commit message from CVS:
* gst/gstutils.c: (gst_element_link_pads),
(gst_element_link_pads_filtered):
Ensure that we set a capsfilter to NULL if we failed to link it
when doing filtered linking, to avoid criticals.

No need to check for unreffing srcpad, which is explicly NULLed
above (a trivial code cleanup).
This commit is contained in:
Michael Smith 2006-08-31 17:13:34 +00:00
parent 47e5ba2f15
commit 858de9793c
2 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,13 @@
2006-08-31 Michael Smith <msmith@fluendo.com>
* gst/gstutils.c: (gst_element_link_pads),
(gst_element_link_pads_filtered):
Ensure that we set a capsfilter to NULL if we failed to link it
when doing filtered linking, to avoid criticals.
No need to check for unreffing srcpad, which is explicly NULLed
above (a trivial code cleanup).
2006-08-31 Wim Taymans <wim@fluendo.com>
* docs/design/part-gstghostpad.txt:

View file

@ -1482,13 +1482,8 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname,
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s:%s",
GST_ELEMENT_NAME (src), GST_DEBUG_PAD_NAME (destpad));
gst_object_unref (destpad);
if (srcpad)
gst_object_unref (srcpad);
return FALSE;
} else {
if (srcpad)
gst_object_unref (srcpad);
srcpad = NULL;
if (destpad)
gst_object_unref (destpad);
destpad = NULL;
@ -1598,8 +1593,9 @@ gst_element_link_pads_filtered (GstElement * src, const gchar * srcpadname,
return TRUE;
} else {
GST_INFO ("Could not link elements");
gst_element_set_state (capsfilter, GST_STATE_NULL);
/* this will unlink and unref as appropriate */
gst_bin_remove (GST_BIN (GST_OBJECT_PARENT (capsfilter)), capsfilter);
/* will unref and unlink as appropriate */
return FALSE;
}
} else {