Merge branch 'master' into 0.11
[platform/upstream/gst-plugins-base.git] / gst / playback / gstsubtitleoverlay.c
index 5744fc0..0cb7213 100644 (file)
@@ -122,8 +122,7 @@ block_video (GstSubtitleOverlay * self)
   if (self->video_block_pad) {
     self->video_block_id =
         gst_pad_add_probe (self->video_block_pad, GST_PROBE_TYPE_BLOCK,
-        _pad_blocked_cb, gst_object_ref (self),
-        (GDestroyNotify) gst_object_unref);
+        _pad_blocked_cb, self, NULL);
   }
 }
 
@@ -146,8 +145,7 @@ block_subtitle (GstSubtitleOverlay * self)
   if (self->subtitle_block_pad) {
     self->subtitle_block_id =
         gst_pad_add_probe (self->subtitle_block_pad, GST_PROBE_TYPE_BLOCK,
-        _pad_blocked_cb, gst_object_ref (self),
-        (GDestroyNotify) gst_object_unref);
+        _pad_blocked_cb, self, NULL);
   }
 }
 
@@ -805,7 +803,6 @@ _pad_blocked_cb (GstPad * pad, GstProbeType type, gpointer type_data,
       /* Unblock pads */
       unblock_video (self);
       unblock_subtitle (self);
-
       goto out;
     } else if (target) {
       gst_object_unref (target);
@@ -2059,6 +2056,7 @@ gst_subtitle_overlay_init (GstSubtitleOverlay * self)
 
   templ = gst_static_pad_template_get (&srctemplate);
   self->srcpad = gst_ghost_pad_new_no_target_from_template ("src", templ);
+  gst_object_unref (templ);
 
   proxypad =
       GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (self->srcpad)));
@@ -2073,6 +2071,7 @@ gst_subtitle_overlay_init (GstSubtitleOverlay * self)
   templ = gst_static_pad_template_get (&video_sinktemplate);
   self->video_sinkpad =
       gst_ghost_pad_new_no_target_from_template ("video_sink", templ);
+  gst_object_unref (templ);
   gst_pad_set_event_function (self->video_sinkpad,
       GST_DEBUG_FUNCPTR (gst_subtitle_overlay_video_sink_event));
   gst_pad_set_chain_function (self->video_sinkpad,
@@ -2082,12 +2081,13 @@ gst_subtitle_overlay_init (GstSubtitleOverlay * self)
       GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD
           (self->video_sinkpad)));
   self->video_block_pad = proxypad;
-
+  gst_object_unref (proxypad);
   gst_element_add_pad (GST_ELEMENT_CAST (self), self->video_sinkpad);
 
   templ = gst_static_pad_template_get (&subtitle_sinktemplate);
   self->subtitle_sinkpad =
       gst_ghost_pad_new_no_target_from_template ("subtitle_sink", templ);
+  gst_object_unref (templ);
   gst_pad_set_link_function (self->subtitle_sinkpad,
       GST_DEBUG_FUNCPTR (gst_subtitle_overlay_subtitle_sink_link));
   gst_pad_set_unlink_function (self->subtitle_sinkpad,
@@ -2105,6 +2105,7 @@ gst_subtitle_overlay_init (GstSubtitleOverlay * self)
       GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD
           (self->subtitle_sinkpad)));
   self->subtitle_block_pad = proxypad;
+  gst_object_unref (proxypad);
 
   gst_element_add_pad (GST_ELEMENT_CAST (self), self->subtitle_sinkpad);