#endif /* __sgi__ */
#endif
+static const gchar *_gst_debug_filter = NULL;
+
static void gst_debug_reset_threshold (gpointer category, gpointer unused);
static void gst_debug_reset_all_thresholds (void);
if (env)
gst_debug_set_color_mode_from_string (env);
- env = g_getenv ("GST_DEBUG");
- if (env) {
- gst_debug_set_threshold_from_string (env, FALSE);
+ _gst_debug_filter = g_getenv ("GST_DEBUG");
+ if (_gst_debug_filter) {
+ gst_debug_set_threshold_from_string (_gst_debug_filter, FALSE);
}
}
}
g_mutex_unlock (&__cat_mutex);
+ /* ensure the filter is applied to categories registered after _debug_init */
+ if (_gst_debug_filter) {
+ gst_debug_set_threshold_from_string (_gst_debug_filter, FALSE);
+ }
+
return cat;
}
const gchar *category;
if (parse_debug_category (values[0], &category)
- && parse_debug_level (values[1], &level))
+ && parse_debug_level (values[1], &level)) {
gst_debug_set_threshold_for_name (category, level);
+
+ /* bump min-level anyway to allow the category to be registered in the
+ * future still */
+ if (level > _gst_debug_min) {
+ _gst_debug_min = level;
+ }
+ }
}
g_strfreev (values);