mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
audiofilter: don't leak pad-template
gst_element_class_add_pad_template() does not take ownership.
This commit is contained in:
parent
164f1dbd1c
commit
ff9ee1dc5a
1 changed files with 9 additions and 6 deletions
|
@ -220,16 +220,19 @@ gst_audio_filter_class_add_pad_templates (GstAudioFilterClass * klass,
|
|||
const GstCaps * allowed_caps)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GstPadTemplate *pad_template;
|
||||
|
||||
g_return_if_fail (GST_IS_AUDIO_FILTER_CLASS (klass));
|
||||
g_return_if_fail (allowed_caps != NULL);
|
||||
g_return_if_fail (GST_IS_CAPS (allowed_caps));
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
||||
gst_caps_copy (allowed_caps)));
|
||||
pad_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
||||
gst_caps_copy (allowed_caps));
|
||||
gst_element_class_add_pad_template (element_class, pad_template);
|
||||
gst_object_unref (pad_template);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||
gst_caps_copy (allowed_caps)));
|
||||
pad_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||
gst_caps_copy (allowed_caps));
|
||||
gst_element_class_add_pad_template (element_class, pad_template);
|
||||
gst_object_unref (pad_template);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue