gst_debug_reset_all_thresholds ();
}
-static void
-gst_debug_apply_patterns_to_category (GstDebugCategory * cat)
-{
- GSList *l;
-
- g_mutex_lock (&__level_name_mutex);
- for (l = __level_name; l != NULL; l = l->next) {
- for_each_threshold_by_entry (cat, (LevelNameEntry *) l->data);
- }
- g_mutex_unlock (&__level_name_mutex);
-}
-
GstDebugCategory *
_gst_debug_category_new (const gchar * name, guint color,
const gchar * description)
}
g_mutex_unlock (&__cat_mutex);
- /* ensure the filter is applied to categories registered after _debug_init */
- gst_debug_apply_patterns_to_category (cat);
-
return cat;
}
/* Note: before the fixes this wouldn't work to trigger the problem because
* only a pattern set via GST_DEBUG before gst_init would be picked up
* (another bug) */
- gst_debug_set_threshold_from_string ("*a*b:6,*c:3,d*:2,xyz*:9,ax:1", TRUE);
+ gst_debug_set_threshold_from_string ("*a*b:6,*b*0:6,*c:3,d*:2,xyz*:9,ax:1",
+ TRUE);
fail_unless_equals_int (GST_LEVEL_DEFAULT,
gst_debug_get_default_threshold ());
/* *c:3 */
fail_unless_equals_int (gst_debug_category_get_threshold (cats[0x4c]),
GST_LEVEL_FIXME);
- /* *a*b:6 */
+ /* *a*b:6 and d*:2, but d*:2 takes priority here as cat name is "dog-a1b"
+ * and order matters: items listed later override earlier ones. */
fail_unless_equals_int (gst_debug_category_get_threshold (cats[0xa1b]),
+ GST_LEVEL_WARNING);
+ /* *a*0:6 */
+ fail_unless_equals_int (gst_debug_category_get_threshold (cats[0xb10]),
GST_LEVEL_LOG);
}