From 2c2fdbf7da515a787efd6133c444ca6856ccdbdb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 22 Mar 2006 18:25:04 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ gst/gstinfo.c | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c427730979..4a3d73e158 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Wim Taymans + + * gst/gstinfo.c: (gst_debug_set_active), + (gst_debug_category_set_threshold): + Disable debugging unless explicitly activated. + Fixes #335480. + 2006-03-22 Wim Taymans * gst/gstelement.c: (gst_element_set_locked_state), diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 2b4bcb4330..b4724934c6 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -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); }