summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d1cb33)
raw | patch | inline | side by side (parent: 7d1cb33)
author | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 27 Sep 2005 15:37:40 +0000 (15:37 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 27 Sep 2005 15:37:40 +0000 (15:37 +0000) |
Original commit message from CVS:
* gst/elements/gsttee.c: (gst_tee_init), (gst_tee_do_push):
* gst/gstutils.c: (intersect_caps_func), (gst_pad_proxy_getcaps),
(link_fold_func), (gst_pad_proxy_setcaps):
Leak fixes, the fold functions need to unref the passed object and
_get_parent_*() returns ref to parent.
* gst/elements/gsttee.c: (gst_tee_init), (gst_tee_do_push):
* gst/gstutils.c: (intersect_caps_func), (gst_pad_proxy_getcaps),
(link_fold_func), (gst_pad_proxy_setcaps):
Leak fixes, the fold functions need to unref the passed object and
_get_parent_*() returns ref to parent.
ChangeLog | patch | blob | history | |
gst/elements/gsttee.c | patch | blob | history | |
gst/gstutils.c | patch | blob | history | |
plugins/elements/gsttee.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 62175d1aa4bd1c29a62ac8e43532402fe3a7e2a2..97dd4b589d7ecf1d7226dd4c95ac1a9093ea095a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2005-09-27 Wim Taymans <wim@fluendo.com>
+
+ * gst/elements/gsttee.c: (gst_tee_init), (gst_tee_do_push):
+ * gst/gstutils.c: (intersect_caps_func), (gst_pad_proxy_getcaps),
+ (link_fold_func), (gst_pad_proxy_setcaps):
+ Leak fixes, the fold functions need to unref the passed object and
+ _get_parent_*() returns ref to parent.
+
2005-09-27 Tim-Philipp Müller <tim at centricular dot net>
* check/gst/gstbuffer.c: (test_make_writable):
diff --git a/gst/elements/gsttee.c b/gst/elements/gsttee.c
index f022f109441b127d1e47906f6a1383ae828f96be..13588c64a2a3006fe6f2ab56436e9604e82a1660 100644 (file)
--- a/gst/elements/gsttee.c
+++ b/gst/elements/gsttee.c
tee->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
"sink");
- gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
gst_pad_set_setcaps_function (tee->sinkpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_setcaps));
gst_pad_set_getcaps_function (tee->sinkpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
+ gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
tee->last_message = NULL;
}
res = gst_pad_push (pad, gst_buffer_ref (data->buffer));
g_value_set_enum (ret, res);
+ gst_object_unref (pad);
+
return (res == GST_FLOW_OK);
}
diff --git a/gst/gstutils.c b/gst/gstutils.c
index 24851c71bd7c8446add3e02302ea2989163bfb97..ef2a4cd648cde07d163fff3c97290e151c64616f 100644 (file)
--- a/gst/gstutils.c
+++ b/gst/gstutils.c
gst_caps_unref (existing);
gst_caps_unref (peercaps);
}
+ gst_object_unref (pad);
return TRUE;
}
&ret, pad);
gst_iterator_free (iter);
- if (res != GST_ITERATOR_DONE) {
- g_warning ("Pad list changed during capsnego for element %s",
- GST_ELEMENT_NAME (element));
- return NULL;
- }
+ if (res != GST_ITERATOR_DONE)
+ goto pads_changed;
+
+ gst_object_unref (element);
caps = g_value_get_pointer (&ret);
g_value_unset (&ret);
gst_caps_unref (caps);
return intersected;
+
+ /* ERRORS */
+pads_changed:
+ {
+ g_warning ("Pad list changed during capsnego for element %s",
+ GST_ELEMENT_NAME (element));
+ gst_object_unref (element);
+ return NULL;
+ }
}
typedef struct
success = gst_pad_set_caps (pad, data->caps);
g_value_set_boolean (ret, success);
}
+ gst_object_unref (pad);
return success;
}
GST_DEBUG ("proxying pad link for %s:%s", GST_DEBUG_PAD_NAME (pad));
element = gst_pad_get_parent_element (pad);
+ if (element == NULL)
+ return FALSE;
iter = gst_element_iterate_pads (element);
&ret, &data);
gst_iterator_free (iter);
- if (res != GST_ITERATOR_DONE) {
+ if (res != GST_ITERATOR_DONE)
+ goto pads_changed;
+
+ gst_object_unref (element);
+
+ /* ok not to unset the gvalue */
+ return g_value_get_boolean (&ret);
+
+ /* ERRORS */
+pads_changed:
+ {
g_warning ("Pad list changed during proxy_pad_link for element %s",
GST_ELEMENT_NAME (element));
+ gst_object_unref (element);
return FALSE;
}
-
- /* ok not to unset the gvalue */
- return g_value_get_boolean (&ret);
}
/**
index f022f109441b127d1e47906f6a1383ae828f96be..13588c64a2a3006fe6f2ab56436e9604e82a1660 100644 (file)
tee->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
"sink");
- gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
gst_pad_set_setcaps_function (tee->sinkpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_setcaps));
gst_pad_set_getcaps_function (tee->sinkpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
+ gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
tee->last_message = NULL;
}
res = gst_pad_push (pad, gst_buffer_ref (data->buffer));
g_value_set_enum (ret, res);
+ gst_object_unref (pad);
+
return (res == GST_FLOW_OK);
}