vtenc: fix caps leak
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 30 Jun 2017 02:08:34 +0000 (11:08 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Fri, 30 Jun 2017 02:08:51 +0000 (11:08 +0900)
Change-Id: Id805bc620ff72b3fa113cd8e85d12e693493cf60

sys/applemedia/vtenc.c

index 258e4e4..7426b07 100644 (file)
@@ -150,7 +150,7 @@ gst_vtenc_base_init (GstVTEncClass * klass)
   const int min_fps_n = 0, max_fps_n = G_MAXINT;
   const int min_fps_d = 1, max_fps_d = 1;
   GstPadTemplate *sink_template, *src_template;
-  GstCaps *src_caps;
+  GstCaps *src_caps, *caps;
   gchar *longname, *description;
 
   longname = g_strdup_printf ("%s encoder", codec_details->name);
@@ -163,9 +163,11 @@ gst_vtenc_base_init (GstVTEncClass * klass)
   g_free (longname);
   g_free (description);
 
+  caps = gst_static_caps_get (&sink_caps);
   sink_template = gst_pad_template_new ("sink",
-      GST_PAD_SINK, GST_PAD_ALWAYS, gst_static_caps_get (&sink_caps));
+      GST_PAD_SINK, GST_PAD_ALWAYS, caps);
   gst_element_class_add_pad_template (element_class, sink_template);
+  gst_caps_unref (caps);
 
   src_caps = gst_caps_new_simple (codec_details->mimetype,
       "width", GST_TYPE_INT_RANGE, min_width, max_width,