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) {
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);
}
}