Simplify activate_inactive_grab_clients().
authorAndre Noll <maan@systemlinux.org>
Wed, 2 Apr 2008 07:56:54 +0000 (09:56 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 2 Apr 2008 07:56:54 +0000 (09:56 +0200)
grab_client.c

index e348ea2..0cd9c32 100644 (file)
@@ -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);
        }
 }