From 33ef3f7d4d5379a09a0becbd04c43b0db01f5281 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 2 May 2003 20:07:45 +0000 Subject: [PATCH] make gst-launch --gst-mask=-1 fakesrc ! fakesink work on Solaris Original commit message from CVS: make gst-launch --gst-mask=-1 fakesrc ! fakesink work on Solaris --- gst/gstelement.c | 4 +--- gst/gstelementfactory.c | 4 ++-- gst/gstinfo.c | 4 ++-- gst/gstinfo.h | 2 +- gst/gstobject.c | 13 ++++++------- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index a16fa9366a..0320fa64bf 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -864,9 +864,7 @@ gst_element_release_locks (GstElement *element) void gst_element_add_pad (GstElement *element, GstPad *pad) { - g_return_if_fail (element != NULL); g_return_if_fail (GST_IS_ELEMENT (element)); - g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_PAD (pad)); /* first check to make sure the pad's parent is already set */ @@ -877,7 +875,7 @@ gst_element_add_pad (GstElement *element, GstPad *pad) /* set the pad's parent */ GST_DEBUG (GST_CAT_ELEMENT_PADS,"setting parent of pad '%s' to '%s'", - GST_PAD_NAME (pad), GST_ELEMENT_NAME (element)); + GST_PAD_NAME (pad), GST_STR_NULL (GST_ELEMENT_NAME (element))); gst_object_set_parent (GST_OBJECT (pad), GST_OBJECT (element)); /* add it to the list */ diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index b70471a547..78f00fd93f 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -214,7 +214,7 @@ gst_element_factory_create (GstElementFactory *factory, GST_DEBUG (GST_CAT_ELEMENT_FACTORY, "creating element from factory \"%s\" (name \"%s\", type %d)", - GST_PLUGIN_FEATURE_NAME (factory), name, (gint) factory->type); + GST_PLUGIN_FEATURE_NAME (factory), GST_STR_NULL (name), (gint) factory->type); if (factory->type == 0) { g_critical ("Factory for `%s' has no type", @@ -265,7 +265,7 @@ gst_element_factory_make (const gchar *factoryname, const gchar *name) g_return_val_if_fail (factoryname != NULL, NULL); GST_DEBUG (GST_CAT_ELEMENT_FACTORY, "gstelementfactory: make \"%s\" \"%s\"", - factoryname, name); + factoryname, GST_STR_NULL (name)); /* gst_plugin_load_element_factory (factoryname); */ factory = gst_element_factory_find (factoryname); diff --git a/gst/gstinfo.c b/gst/gstinfo.c index b2f478e916..7479f9d3b3 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -208,7 +208,7 @@ gst_default_debug_handler (gint category, gboolean incore, if (element && GST_IS_ELEMENT (element)) #ifdef GST_DEBUG_COLOR elementname = g_strdup_printf (" \033[04m[%s]\033[00m", - GST_OBJECT_NAME (element)); + GST_STR_NULL (GST_OBJECT_NAME (element))); #else elementname = g_strdup_printf (" [%s]", GST_OBJECT_NAME (element)); #endif @@ -490,6 +490,7 @@ GHashTable *__gst_function_pointers = NULL; gchar *_gst_debug_nameof_funcptr (void *ptr) G_GNUC_NO_INSTRUMENT; +/* This function MUST NOT return NULL */ gchar * _gst_debug_nameof_funcptr (void *ptr) { @@ -502,7 +503,6 @@ _gst_debug_nameof_funcptr (void *ptr) } else { return g_strdup_printf("%p",ptr); } - return NULL; } void * diff --git a/gst/gstinfo.h b/gst/gstinfo.h index 9793af82d4..091ac1380b 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -204,7 +204,7 @@ G_GNUC_UNUSED static gchar *_debug_string = NULL; /********** some convenience macros for debugging **********/ #define GST_DEBUG_PAD_NAME(pad) \ (GST_OBJECT_PARENT(pad) != NULL) ? \ - GST_OBJECT_NAME (GST_OBJECT_PARENT(pad)) : \ + GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \ "''", GST_OBJECT_NAME (pad) #ifdef G_HAVE_ISO_VARARGS diff --git a/gst/gstobject.c b/gst/gstobject.c index f5d0973ae5..2c8adeff44 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -183,7 +183,7 @@ gst_object_ref (GstObject *object) g_return_val_if_fail (GST_IS_OBJECT (object), NULL); GST_DEBUG (GST_CAT_REFCOUNTING, "ref %p '%s' %d->%d", object, - GST_OBJECT_NAME (object), + GST_STR_NULL (GST_OBJECT_NAME (object)), G_OBJECT (object)->ref_count, G_OBJECT (object)->ref_count + 1); @@ -205,7 +205,7 @@ gst_object_unref (GstObject *object) g_return_if_fail (G_OBJECT (object)->ref_count > 0); GST_DEBUG (GST_CAT_REFCOUNTING, "unref %p '%s' %d->%d", object, - GST_OBJECT_NAME (object), + GST_STR_NULL (GST_OBJECT_NAME (object)), G_OBJECT (object)->ref_count, G_OBJECT (object)->ref_count - 1); @@ -227,7 +227,7 @@ gst_object_sink (GstObject *object) g_return_if_fail (object != NULL); g_return_if_fail (GST_IS_OBJECT (object)); - GST_DEBUG (GST_CAT_REFCOUNTING, "sink %p '%s'", object, GST_OBJECT_NAME (object)); + GST_DEBUG (GST_CAT_REFCOUNTING, "sink %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object))); if (GST_OBJECT_FLOATING (object)) { GST_FLAG_UNSET (object, GST_FLOATING); @@ -259,7 +259,7 @@ gst_object_replace (GstObject **oldobj, GstObject *newobj) static void gst_object_dispose (GObject *object) { - GST_DEBUG (GST_CAT_REFCOUNTING, "dispose %p '%s'", object, GST_OBJECT_NAME (object)); + GST_DEBUG (GST_CAT_REFCOUNTING, "dispose %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object))); GST_FLAG_SET (GST_OBJECT (object), GST_DESTROYED); GST_OBJECT_PARENT (object) = NULL; @@ -273,12 +273,11 @@ gst_object_finalize (GObject *object) { GstObject *gstobject = GST_OBJECT (object); - GST_DEBUG (GST_CAT_REFCOUNTING, "finalize %p '%s'", object, GST_OBJECT_NAME (object)); + GST_DEBUG (GST_CAT_REFCOUNTING, "finalize %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object))); g_signal_handlers_destroy (object); - if (gstobject->name != NULL) - g_free (gstobject->name); + g_free (gstobject->name); g_mutex_free (gstobject->lock);