gst/gstinfo.c: Disable debugging unless explicitly activated.

Original commit message from CVS:
* gst/gstinfo.c: (gst_debug_set_active),
(gst_debug_category_set_threshold):
Disable debugging unless explicitly activated.
Fixes #335480.
This commit is contained in:
Wim Taymans 2006-03-22 18:25:04 +00:00
parent 0e984d3026
commit 2c2fdbf7da
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2006-03-22 Wim Taymans <wim@fluendo.com>
* gst/gstinfo.c: (gst_debug_set_active),
(gst_debug_category_set_threshold):
Disable debugging unless explicitly activated.
Fixes #335480.
2006-03-22 Wim Taymans <wim@fluendo.com>
* gst/gstelement.c: (gst_element_set_locked_state),

View file

@ -189,8 +189,10 @@ static GSList *__log_functions = NULL;
static gint __default_level;
static gint __use_color;
/* enabled by default */
gboolean __gst_debug_enabled = TRUE;
/* disabled by default, as soon as some threshold is set > NONE,
* it becomes enabled. */
gboolean __gst_debug_enabled = FALSE;
static gboolean __gst_debug_min = GST_LEVEL_NONE;
GstDebugCategory *GST_CAT_DEFAULT = NULL;
@ -793,6 +795,10 @@ void
gst_debug_set_active (gboolean active)
{
__gst_debug_enabled = active;
if (active)
__gst_debug_min = GST_LEVEL_NONE;
else
__gst_debug_min = GST_LEVEL_COUNT;
}
/**
@ -1008,6 +1014,9 @@ gst_debug_category_set_threshold (GstDebugCategory * category,
{
g_return_if_fail (category != NULL);
if (level > __gst_debug_min)
__gst_debug_enabled = TRUE;
gst_atomic_int_set (&category->threshold, level);
}