gst/gst.c: Don't use GST_INFO before the debug system is actually initialised (should...
authorTim-Philipp Müller <tim@centricular.net>
Thu, 23 Aug 2007 20:41:30 +0000 (20:41 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 23 Aug 2007 20:41:30 +0000 (20:41 +0000)
Original commit message from CVS:
* gst/gst.c:
Don't use GST_INFO before the debug system is actually initialised
(shouldn't do any harm, but won't print anything either, so we can
just as well remove it).
* gst/gstinfo.h:
GST_CAT_LEVEL_LOG_valist(), which is our inline helper function for
compilers that don't support variadic macros (such as MSVC), should
check for debug_level <= __gst_debug_min as well, since that's the
function called from all the level-specific GST_CAT_*_LOG_OBJECT()
inline helper functions. Should improve performance a bit, but also
makes sure uses of GST_INFO et.al are ignored if the debugging
system isn't initialised yet (instead of printing an assertion
failure).

ChangeLog
gst/gst.c
gst/gstinfo.h

index 7307872..b07abe4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2007-08-23  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/gst.c:
+         Don't use GST_INFO before the debug system is actually initialised
+         (shouldn't do any harm, but won't print anything either, so we can
+         just as well remove it).
+
+       * gst/gstinfo.h:
+         GST_CAT_LEVEL_LOG_valist(), which is our inline helper function for
+         compilers that don't support variadic macros (such as MSVC), should
+         check for debug_level <= __gst_debug_min as well, since that's the
+         function called from all the level-specific GST_CAT_*_LOG_OBJECT()
+         inline helper functions. Should improve performance a bit, but also
+         makes sure uses of GST_INFO et.al are ignored if the debugging
+         system isn't initialised yet (instead of printing an assertion
+         failure).
+
 2007-08-23  Stefan Kost  <ensonic@users.sf.net>
 
        patch by: David Nečas <yeti@physics.muni.cz>
index c2ae6a1..a4ec444 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -407,8 +407,6 @@ gst_init_check (int *argc, char **argv[], GError ** err)
   if (!g_thread_supported ())
     g_thread_init (NULL);
 
-  GST_INFO ("initializing GStreamer");
-
   if (gst_initialized) {
     GST_DEBUG ("already initialized gst");
     return TRUE;
index 2042b26..79ce5bd 100644 (file)
@@ -441,21 +441,21 @@ static inline void
 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
 {
-  gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
-      varargs);
+  if (G_UNLIKELY (level <= __gst_debug_min)) {
+    gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
+        varargs);
+  }
 }
 
 static inline void
 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
     gpointer object, const char *format, ...)
 {
-  if (G_UNLIKELY (level <= __gst_debug_min)) {
-    va_list varargs;
+  va_list varargs;
 
-    va_start (varargs, format);
-    GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
-    va_end (varargs);
-  }
+  va_start (varargs, format);
+  GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
+  va_end (varargs);
 }
 #endif
 #endif /* G_HAVE_ISO_VARARGS */