fact1_tmpl_caps = get_template_caps (fact1, GST_PAD_SRC);
fact2_tmpl_caps = get_template_caps (fact2, GST_PAD_SINK);
if (!fact1_tmpl_caps || !fact2_tmpl_caps) {
+ if (fact1_tmpl_caps) gst_caps_unref (fact1_tmpl_caps);
+ if (fact2_tmpl_caps) gst_caps_unref (fact2_tmpl_caps);
+
GST_ERROR ("Failed to get template caps from decoder or sink");
return 0;
}
gst_caps_unref (fact1_tmpl_caps);
gst_caps_unref (fact2_tmpl_caps);
+ gst_caps_unref (raw_caps);
return n_common_cf;
}
static GstPadTemplate *
gst_video_scale_src_template_factory (void)
{
- return gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
- gst_video_scale_get_capslist ());
+ GstCaps *tmp = gst_video_scale_get_capslist ();
+ GstPadTemplate *tmpl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, tmp);
+ gst_caps_unref (tmp);
+ return tmpl;
}
static GstPadTemplate *
gst_video_scale_sink_template_factory (void)
{
- return gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
- gst_video_scale_get_capslist ());
+ GstCaps *tmp = gst_video_scale_get_capslist ();
+ GstPadTemplate *tmpl = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, tmp);
+ gst_caps_unref (tmp);
+ return tmpl;
}