mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +00:00
info: return existing category if a debug category is registered twice
If a category with the same name is found when creating a new
one, the found category is returned instead of an invalid pointer.
Fixes issue with gst-vaapi (which uses an internal copy of the
codec parsers) caused by commit ccba9130
.
https://bugzilla.gnome.org/show_bug.cgi?id=720036
This commit is contained in:
parent
53ae1b2c9c
commit
24a766a13b
1 changed files with 4 additions and 2 deletions
|
@ -1509,7 +1509,7 @@ GstDebugCategory *
|
|||
_gst_debug_category_new (const gchar * name, guint color,
|
||||
const gchar * description)
|
||||
{
|
||||
GstDebugCategory *cat;
|
||||
GstDebugCategory *cat, *catfound;
|
||||
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
|
@ -1526,10 +1526,12 @@ _gst_debug_category_new (const gchar * name, guint color,
|
|||
|
||||
/* add to category list */
|
||||
g_mutex_lock (&__cat_mutex);
|
||||
if (_gst_debug_get_category_locked (name)) {
|
||||
catfound = _gst_debug_get_category_locked (name);
|
||||
if (catfound) {
|
||||
g_free ((gpointer) cat->name);
|
||||
g_free ((gpointer) cat->description);
|
||||
g_slice_free (GstDebugCategory, cat);
|
||||
cat = catfound;
|
||||
} else {
|
||||
__categories = g_slist_prepend (__categories, cat);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue