mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 16:18:16 +00:00
gstinfo: Simplify gst_debug_reset_threshold() implementation
Replace the while+goto with a for+break and check walk to determine whether we had a match. Move up the unlock to keep the locked section as small as possible. https://bugzilla.gnome.org/show_bug.cgi?id=794717
This commit is contained in:
parent
b12df466f2
commit
c4ff069864
1 changed files with 6 additions and 8 deletions
|
@ -1598,18 +1598,16 @@ gst_debug_reset_threshold (gpointer category, gpointer unused)
|
|||
GSList *walk;
|
||||
|
||||
g_mutex_lock (&__level_name_mutex);
|
||||
walk = __level_name;
|
||||
while (walk) {
|
||||
LevelNameEntry *entry = walk->data;
|
||||
|
||||
walk = g_slist_next (walk);
|
||||
if (gst_debug_apply_entry (cat, entry))
|
||||
goto exit;
|
||||
for (walk = __level_name; walk != NULL; walk = walk->next) {
|
||||
if (gst_debug_apply_entry (cat, walk->data))
|
||||
break;
|
||||
}
|
||||
gst_debug_category_set_threshold (cat, gst_debug_get_default_threshold ());
|
||||
|
||||
exit:
|
||||
g_mutex_unlock (&__level_name_mutex);
|
||||
|
||||
if (walk == NULL)
|
||||
gst_debug_category_set_threshold (cat, gst_debug_get_default_threshold ());
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue