mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
gst/gstelement.c: simplify
Original commit message from CVS: * gst/gstelement.c: (gst_element_dispose): simplify * gst/gstpad.c: (gst_pad_call_chain_function): don't create loads of events due to bad macro usage
This commit is contained in:
parent
ac0fd9c5bf
commit
bb7d6621fd
3 changed files with 13 additions and 24 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-04-17 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* gst/gstelement.c: (gst_element_dispose):
|
||||||
|
simplify
|
||||||
|
* gst/gstpad.c: (gst_pad_call_chain_function):
|
||||||
|
don't create loads of events due to bad macro usage
|
||||||
|
|
||||||
2004-04-16 David Schleef <ds@schleef.org>
|
2004-04-16 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* gst/gstcaps.c: (gst_caps_is_fixed_foreach):
|
* gst/gstcaps.c: (gst_caps_is_fixed_foreach):
|
||||||
|
|
|
@ -2974,33 +2974,14 @@ static void
|
||||||
gst_element_dispose (GObject * object)
|
gst_element_dispose (GObject * object)
|
||||||
{
|
{
|
||||||
GstElement *element = GST_ELEMENT (object);
|
GstElement *element = GST_ELEMENT (object);
|
||||||
GList *pads;
|
|
||||||
GstPad *pad;
|
|
||||||
|
|
||||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "dispose");
|
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "dispose");
|
||||||
|
|
||||||
gst_element_set_state (element, GST_STATE_NULL);
|
gst_element_set_state (element, GST_STATE_NULL);
|
||||||
|
|
||||||
/* first we break all our links with the ouside */
|
/* first we break all our links with the ouside */
|
||||||
if (element->pads) {
|
while (element->pads) {
|
||||||
GList *orig;
|
gst_element_remove_pad (element, GST_PAD (element->pads->data));
|
||||||
|
|
||||||
orig = pads = g_list_copy (element->pads);
|
|
||||||
while (pads) {
|
|
||||||
pad = GST_PAD (pads->data);
|
|
||||||
|
|
||||||
if (GST_PAD_PEER (pad)) {
|
|
||||||
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "unlinking pad '%s'",
|
|
||||||
GST_OBJECT_NAME (GST_OBJECT (GST_PAD (GST_PAD_PEER (pad)))));
|
|
||||||
gst_pad_unlink (pad, GST_PAD (GST_PAD_PEER (pad)));
|
|
||||||
}
|
|
||||||
gst_element_remove_pad (element, pad);
|
|
||||||
|
|
||||||
pads = g_list_next (pads);
|
|
||||||
}
|
|
||||||
g_list_free (orig);
|
|
||||||
g_list_free (element->pads);
|
|
||||||
element->pads = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
element->numsrcpads = 0;
|
element->numsrcpads = 0;
|
||||||
|
|
|
@ -4212,11 +4212,12 @@ gst_pad_get_formats (GstPad * pad)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CALL_CHAINFUNC(pad, data) G_STMT_START {\
|
#define CALL_CHAINFUNC(pad, data) G_STMT_START {\
|
||||||
if (GST_IS_EVENT (data) && \
|
GstData *__temp = (data); \
|
||||||
|
if (GST_IS_EVENT (__temp) && \
|
||||||
!GST_FLAG_IS_SET (gst_pad_get_parent (pad), GST_ELEMENT_EVENT_AWARE)) { \
|
!GST_FLAG_IS_SET (gst_pad_get_parent (pad), GST_ELEMENT_EVENT_AWARE)) { \
|
||||||
gst_pad_send_event (pad, GST_EVENT (data)); \
|
gst_pad_send_event (pad, GST_EVENT (__temp)); \
|
||||||
} else { \
|
} else { \
|
||||||
GST_RPAD_CHAINFUNC (pad) (pad, data); \
|
GST_RPAD_CHAINFUNC (pad) (pad, __temp); \
|
||||||
} \
|
} \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue