summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-06-09 01:53:01 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-06-09 01:53:01 +0000
commitaeadb64d5f15795482c02edee5ff30bcddaff7d5 (patch)
treed83a23211a68a67f5620d7334878fcdf802f3e95
parente387e02308f6b933ae91444b9f084d114293dfd4 (diff)
src/gstplugin.c: Fix some memory leaks, and make the setcaps function actually sets the caps on the other pad.
Original commit message from CVS: * src/gstplugin.c: Fix some memory leaks, and make the setcaps function actually sets the caps on the other pad.
m---------common0
-rw-r--r--gst-plugin/ChangeLog6
-rw-r--r--gst-plugin/src/gstplugin.c15
3 files changed, 12 insertions, 9 deletions
diff --git a/common b/common
-Subproject ba3dd2882b1611f8115f9664e3b85e1fd956b53
+Subproject 46ec7dfc1c09ff550ed6b7a4e0d3f2b2ac7d3ee
diff --git a/gst-plugin/ChangeLog b/gst-plugin/ChangeLog
index 059a6b0..9667c46 100644
--- a/gst-plugin/ChangeLog
+++ b/gst-plugin/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-09 Jan Schmidt <jan.schmidt@sun.com>
+
+ * src/gstplugin.c:
+ Fix some memory leaks, and make the setcaps function actually
+ sets the caps on the other pad.
+
2008-05-08 Stefan Kost <ensonic@users.sf.net>
* README:
diff --git a/gst-plugin/src/gstplugin.c b/gst-plugin/src/gstplugin.c
index 1443020..2a8b23a 100644
--- a/gst-plugin/src/gstplugin.c
+++ b/gst-plugin/src/gstplugin.c
@@ -156,24 +156,20 @@ gst_plugin_template_init (GstPluginTemplate * filter,
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter);
- filter->sinkpad =
- gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
- "sink"), "sink");
+ filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
gst_pad_set_setcaps_function (filter->sinkpad,
GST_DEBUG_FUNCPTR(gst_plugin_template_set_caps));
gst_pad_set_getcaps_function (filter->sinkpad,
GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));
+ gst_pad_set_chain_function (filter->sinkpad,
+ GST_DEBUG_FUNCPTR(gst_plugin_template_chain));
- filter->srcpad =
- gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
- "src"), "src");
+ filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_set_getcaps_function (filter->srcpad,
GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
- gst_pad_set_chain_function (filter->sinkpad,
- GST_DEBUG_FUNCPTR(gst_plugin_template_chain));
filter->silent = FALSE;
}
@@ -220,8 +216,9 @@ gst_plugin_template_set_caps (GstPad * pad, GstCaps * caps)
filter = GST_PLUGIN_TEMPLATE (gst_pad_get_parent (pad));
otherpad = (pad == filter->srcpad) ? filter->sinkpad : filter->srcpad;
+ gst_object_unref (filter);
- return gst_pad_set_caps (pad, caps);
+ return gst_pad_set_caps (otherpad, caps);
}
/* chain function