From 0c2e588a851f7fbd59e3d563c78e8edaf3754192 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 2 Apr 2008 09:56:54 +0200 Subject: [PATCH] Simplify activate_inactive_grab_clients(). --- grab_client.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/grab_client.c b/grab_client.c index e348ea2b..0cd9c320 100644 --- a/grab_client.c +++ b/grab_client.c @@ -179,7 +179,7 @@ void activate_inactive_grab_clients(int slot_num, int audio_format_num, struct filter_chain *fc) { struct grab_client *gc, *tmp; - int i; + int filter_num; struct filter_node *fn; list_for_each_entry_safe(gc, tmp, &inactive_grab_client_list, node) { @@ -189,15 +189,12 @@ void activate_inactive_grab_clients(int slot_num, int audio_format_num, if (gc->audio_format_num >= 0 && gc->audio_format_num != audio_format_num) continue; - if (gc->conf->filter_num_arg >= 0 && - num_filters(gc->audio_format_num) - < gc->conf->filter_num_arg) + filter_num = gc->conf->filter_num_arg; + if (filter_num >= 0 && filter_num >= num_filters(gc->audio_format_num)) continue; - FOR_EACH_FILTER_NODE(fn, fc, i) { - if (gc->conf->filter_num_arg <= 0 - || i == gc->conf->filter_num_arg + 1) - break; - } + if (filter_num < 0) + filter_num = 0; + fn = fc->filter_nodes + filter_num; activate_grab_client(gc, fn); } } -- 2.39.5