info: always check match patterns for new debug categories

Not only if a match pattern was set originally via GST_DEBUG.
Patterns might be set programmatically as well after all.
This commit is contained in:
Tim-Philipp Müller 2017-12-02 12:29:20 +00:00
parent 67e9d13950
commit 9b944f7fd0

View file

@ -240,8 +240,6 @@ dladdr (void *address, Dl_info * dl)
#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);
@ -464,10 +462,9 @@ _priv_gst_debug_init (void)
if (env)
gst_debug_set_color_mode_from_string (env);
_gst_debug_filter = g_getenv ("GST_DEBUG");
if (_gst_debug_filter) {
gst_debug_set_threshold_from_string (_gst_debug_filter, FALSE);
}
env = g_getenv ("GST_DEBUG");
if (env)
gst_debug_set_threshold_from_string (env, FALSE);
}
/* we can't do this further above, because we initialize the GST_CAT_DEFAULT struct */
@ -1737,9 +1734,7 @@ _gst_debug_category_new (const gchar * name, guint color,
g_mutex_unlock (&__cat_mutex);
/* ensure the filter is applied to categories registered after _debug_init */
if (_gst_debug_filter) {
gst_debug_apply_patterns_to_category (cat);
}
gst_debug_apply_patterns_to_category (cat);
return cat;
}