summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-12-04 17:35:18 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-12-04 17:35:18 -0500
commitccba91308dd323f1c9d9caaf8e92951c5c840c03 (patch)
tree8b3d60574ff75602400fbd8e7852a73e6bb5f919
parente0317288ba75ec5ff41f12a834c76d74ca390e2c (diff)
info: Make sure the same category is not added twice
-rw-r--r--gst/gstinfo.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/gstinfo.c b/gst/gstinfo.c
index ab454b524..c9d8325bc 100644
--- a/gst/gstinfo.c
+++ b/gst/gstinfo.c
@@ -248,6 +248,9 @@ LevelNameEntry;
static GMutex __cat_mutex;
static GSList *__categories = NULL;
+static GstDebugCategory *_gst_debug_get_category_locked (const gchar * name);
+
+
/* all registered debug handlers */
typedef struct
{
@@ -1523,7 +1526,13 @@ _gst_debug_category_new (const gchar * name, guint color,
/* add to category list */
g_mutex_lock (&__cat_mutex);
- __categories = g_slist_prepend (__categories, cat);
+ if (_gst_debug_get_category_locked (name)) {
+ g_free ((gpointer) cat->name);
+ g_free ((gpointer) cat->description);
+ g_slice_free (GstDebugCategory, cat);
+ } else {
+ __categories = g_slist_prepend (__categories, cat);
+ }
g_mutex_unlock (&__cat_mutex);
return cat;