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:
Benjamin Otte 2004-04-17 03:26:46 +00:00
parent ac0fd9c5bf
commit bb7d6621fd
3 changed files with 13 additions and 24 deletions

View file

@ -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>
* gst/gstcaps.c: (gst_caps_is_fixed_foreach):

View file

@ -2974,33 +2974,14 @@ static void
gst_element_dispose (GObject * object)
{
GstElement *element = GST_ELEMENT (object);
GList *pads;
GstPad *pad;
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "dispose");
gst_element_set_state (element, GST_STATE_NULL);
/* first we break all our links with the ouside */
if (element->pads) {
GList *orig;
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;
while (element->pads) {
gst_element_remove_pad (element, GST_PAD (element->pads->data));
}
element->numsrcpads = 0;

View file

@ -4212,11 +4212,12 @@ gst_pad_get_formats (GstPad * pad)
}
#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_pad_send_event (pad, GST_EVENT (data)); \
gst_pad_send_event (pad, GST_EVENT (__temp)); \
} else { \
GST_RPAD_CHAINFUNC (pad) (pad, data); \
GST_RPAD_CHAINFUNC (pad) (pad, __temp); \
} \
}G_STMT_END
/**