From 84c5db2635c44fa7c4004b05401f400ee6bad382 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 2 May 2009 14:36:50 +0200 Subject: [PATCH] Use new _ref_sink when we can --- gst/gstpadtemplate.c | 3 +-- gst/gstregistry.c | 9 +++------ gst/gstsystemclock.c | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gst/gstpadtemplate.c b/gst/gstpadtemplate.c index 53c51bc..217b665 100644 --- a/gst/gstpadtemplate.c +++ b/gst/gstpadtemplate.c @@ -231,8 +231,7 @@ gst_pad_template_init (GstPadTemplate * templ) * owned by the creator of the object */ if (GST_OBJECT_IS_FLOATING (templ)) { - gst_object_ref (templ); - gst_object_sink (templ); + gst_object_ref_sink (templ); } } diff --git a/gst/gstregistry.c b/gst/gstregistry.c index fe5b447..2b67902 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -241,8 +241,7 @@ gst_registry_get_default (void) g_static_mutex_lock (&_gst_registry_mutex); if (G_UNLIKELY (!_gst_registry_default)) { _gst_registry_default = g_object_new (GST_TYPE_REGISTRY, NULL); - gst_object_ref (GST_OBJECT_CAST (_gst_registry_default)); - gst_object_sink (GST_OBJECT_CAST (_gst_registry_default)); + gst_object_ref_sink (GST_OBJECT_CAST (_gst_registry_default)); } registry = _gst_registry_default; g_static_mutex_unlock (&_gst_registry_mutex); @@ -353,8 +352,7 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin) registry->plugins = g_list_prepend (registry->plugins, plugin); - gst_object_ref (plugin); - gst_object_sink (plugin); + gst_object_ref_sink (plugin); GST_OBJECT_UNLOCK (registry); GST_LOG_OBJECT (registry, "emitting plugin-added for filename \"%s\"", @@ -461,8 +459,7 @@ gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature) gst_object_unref (existing_feature); } - gst_object_ref (feature); - gst_object_sink (feature); + gst_object_ref_sink (feature); GST_OBJECT_UNLOCK (registry); GST_LOG_OBJECT (registry, "emitting feature-added for %s", feature->name); diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index 41398f7..9c6e16f 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -268,8 +268,7 @@ gst_system_clock_obtain (void) /* we created the global clock; take ownership so * we can hand out instances later */ - gst_object_ref (clock); - gst_object_sink (GST_OBJECT (clock)); + gst_object_ref_sink (clock); _the_system_clock = clock; g_static_mutex_unlock (&_gst_sysclock_mutex); -- 2.7.4