mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
gst/gstelement.c: use correct sinkpad, if only sinkpad is specified, but not srcpad (fixes #147889)
Original commit message from CVS: * gst/gstelement.c: (gst_element_link_pads_filtered): use correct sinkpad, if only sinkpad is specified, but not srcpad (fixes #147889) * gst/gstelement.c: (gst_element_set_state_func), (gst_element_change_state): ref/unref the element, signal handlers could get rid of the element otherwise
This commit is contained in:
parent
8b895dadce
commit
e5a3b3f338
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-07-20 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* gst/gstelement.c: (gst_element_link_pads_filtered):
|
||||||
|
use correct sinkpad, if only sinkpad is specified, but not srcpad
|
||||||
|
(fixes #147889)
|
||||||
|
* gst/gstelement.c: (gst_element_set_state_func),
|
||||||
|
(gst_element_change_state): ref/unref the element, signal handlers
|
||||||
|
could get rid of the element otherwise
|
||||||
|
|
||||||
2004-07-20 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2004-07-20 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* docs/random/ds/0.9-suggested-changes:
|
* docs/random/ds/0.9-suggested-changes:
|
||||||
|
|
|
@ -1891,7 +1891,8 @@ gst_element_link_pads_filtered (GstElement * src, const gchar * srcpadname,
|
||||||
GST_DEBUG_PAD_NAME (srcpad));
|
GST_DEBUG_PAD_NAME (srcpad));
|
||||||
if ((GST_PAD_DIRECTION (srcpad) == GST_PAD_SRC) &&
|
if ((GST_PAD_DIRECTION (srcpad) == GST_PAD_SRC) &&
|
||||||
(GST_PAD_PEER (srcpad) == NULL)) {
|
(GST_PAD_PEER (srcpad) == NULL)) {
|
||||||
GstPad *temp = gst_element_get_compatible_pad_filtered (dest, srcpad,
|
GstPad *temp = destpadname ? destpad :
|
||||||
|
gst_element_get_compatible_pad_filtered (dest, srcpad,
|
||||||
filtercaps);
|
filtercaps);
|
||||||
|
|
||||||
if (temp && gst_pad_link_filtered (srcpad, temp, filtercaps)) {
|
if (temp && gst_pad_link_filtered (srcpad, temp, filtercaps)) {
|
||||||
|
@ -2753,6 +2754,8 @@ gst_element_set_state_func (GstElement * element, GstElementState state)
|
||||||
return GST_STATE_SUCCESS;
|
return GST_STATE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* reentrancy issues with signals in change_state) */
|
||||||
|
gst_object_ref (GST_OBJECT (element));
|
||||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "setting state from %s to %s",
|
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "setting state from %s to %s",
|
||||||
gst_element_state_get_name (curpending),
|
gst_element_state_get_name (curpending),
|
||||||
gst_element_state_get_name (state));
|
gst_element_state_get_name (state));
|
||||||
|
@ -2817,6 +2820,7 @@ gst_element_set_state_func (GstElement * element, GstElementState state)
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
gst_object_unref (GST_OBJECT (element));
|
||||||
|
|
||||||
return return_val;
|
return return_val;
|
||||||
}
|
}
|
||||||
|
@ -2945,6 +2949,9 @@ gst_element_change_state (GstElement * element)
|
||||||
return GST_STATE_SUCCESS;
|
return GST_STATE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* we need to ref the object because of reentrancy issues with the signal
|
||||||
|
* handlers (including those in pads and gst_bin_child_state_change */
|
||||||
|
gst_object_ref (GST_OBJECT (element));
|
||||||
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element,
|
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element,
|
||||||
"default handler tries setting state from %s to %s (%04x)",
|
"default handler tries setting state from %s to %s (%04x)",
|
||||||
gst_element_state_get_name (old_state),
|
gst_element_state_get_name (old_state),
|
||||||
|
@ -3036,12 +3043,14 @@ gst_element_change_state (GstElement * element)
|
||||||
g_cond_signal (element->state_cond);
|
g_cond_signal (element->state_cond);
|
||||||
g_mutex_unlock (element->state_mutex);
|
g_mutex_unlock (element->state_mutex);
|
||||||
|
|
||||||
|
gst_object_unref (GST_OBJECT (element));
|
||||||
return GST_STATE_SUCCESS;
|
return GST_STATE_SUCCESS;
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
/* undo the state change */
|
/* undo the state change */
|
||||||
GST_STATE (element) = old_state;
|
GST_STATE (element) = old_state;
|
||||||
GST_STATE_PENDING (element) = old_pending;
|
GST_STATE_PENDING (element) = old_pending;
|
||||||
|
gst_object_unref (GST_OBJECT (element));
|
||||||
|
|
||||||
return GST_STATE_FAILURE;
|
return GST_STATE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue