Commit 14dc964f authored by Garima Gaur's avatar Garima Gaur Committed by Tim-Philipp Müller

Fix some caps leaks when creating pad templates

https://bugzilla.gnome.org/show_bug.cgi?id=776700
parent beb11a99
......@@ -107,6 +107,9 @@ gst_ffmpegauddec_base_init (GstFFMpegAudDecClass * klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_caps_unref (sinkcaps);
gst_caps_unref (srccaps);
klass->in_plugin = in_plugin;
klass->srctempl = srctempl;
klass->sinktempl = sinktempl;
......
......@@ -124,6 +124,9 @@ gst_ffmpegaudenc_base_init (GstFFMpegAudEncClass * klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_caps_unref (sinkcaps);
gst_caps_unref (srccaps);
klass->in_plugin = in_plugin;
klass->srctempl = srctempl;
klass->sinktempl = sinktempl;
......
......@@ -217,6 +217,8 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass)
gst_element_class_add_pad_template (element_class, audiosrctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_caps_unref (sinkcaps);
klass->in_plugin = in_plugin;
klass->videosrctempl = videosrctempl;
klass->audiosrctempl = audiosrctempl;
......
......@@ -269,17 +269,20 @@ gst_ffmpegmux_base_init (gpointer g_class)
/* pad templates */
srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps);
gst_element_class_add_pad_template (element_class, srctempl);
gst_caps_unref (srccaps);
if (audiosinkcaps) {
audiosinktempl = gst_pad_template_new ("audio_%u",
GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps);
gst_element_class_add_pad_template (element_class, audiosinktempl);
gst_caps_unref (audiosinkcaps);
}
if (videosinkcaps) {
videosinktempl = gst_pad_template_new ("video_%u",
GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps);
gst_element_class_add_pad_template (element_class, videosinktempl);
gst_caps_unref (videosinkcaps);
}
beach:
......
......@@ -192,6 +192,9 @@ gst_ffmpegviddec_base_init (GstFFMpegVidDecClass * klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_caps_unref (sinkcaps);
gst_caps_unref (srccaps);
klass->in_plugin = in_plugin;
}
......
......@@ -161,6 +161,9 @@ gst_ffmpegvidenc_base_init (GstFFMpegVidEncClass * klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_caps_unref (sinkcaps);
gst_caps_unref (srccaps);
klass->in_plugin = in_plugin;
klass->srctempl = srctempl;
klass->sinktempl = sinktempl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment