Merge commit 'meins/master'
[paraslash.git] / audiod_command.c
index 0428bea..b4c50dc 100644 (file)
@@ -279,8 +279,7 @@ out:
 
 static struct filter_node *find_filter_node(int slot_num, int format, int filternum)
 {
-       struct filter_node *fn;
-       int i, j;
+       int i;
 
        FOR_EACH_SLOT(i) {
                struct slot_info *s = &slot[i];
@@ -290,15 +289,10 @@ static struct filter_node *find_filter_node(int slot_num, int format, int filter
                        continue;
                if (format >= 0 && s->format != format)
                        continue;
-               if (num_filters(i) < filternum)
+               if (num_filters(i) <= filternum)
                        continue;
                /* success */
-               j = 1;
-               FOR_EACH_FILTER_NODE(fn, s->fc, j) {
-                       if (filternum <= 0 || j++ == filternum)
-                               break;
-               }
-               return fn;
+               return  s->fc->filter_nodes + filternum;
        }
        return NULL;
 }