wmadec: Switch to the alternative post select method.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 13:43:34 +0000 (13:43 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:45 +0000 (14:12 +0200)
wmadec_filter.c

index ce8d7e8..1beeb5a 100644 (file)
@@ -1210,7 +1210,7 @@ static int wmadec_execute(struct btr_node *btrn, const char *cmd, char **result)
 
 #define WMA_OUTPUT_BUFFER_SIZE (128 * 1024)
 
-static void wmadec_post_select(__a_unused struct sched *s, struct task *t)
+static int wmadec_post_select(__a_unused struct sched *s, struct task *t)
 {
        struct filter_node *fn = container_of(t, struct filter_node, task);
        int ret, converted, out_size;
@@ -1221,12 +1221,11 @@ static void wmadec_post_select(__a_unused struct sched *s, struct task *t)
 
 next_buffer:
        converted = 0;
-       t->error = 0;
        ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
        if (ret < 0)
                goto err;
        if (ret == 0)
-               return;
+               return 0;
        btr_merge(btrn, fn->min_iqs);
        len = btr_next_buffer(btrn, (char **)&in);
        ret = -E_WMADEC_EOF;
@@ -1262,11 +1261,11 @@ next_buffer:
        converted += ret + WMA_FRAME_SKIP;
 success:
        btr_consume(btrn, converted);
-       return;
+       return 0;
 err:
        assert(ret < 0);
-       t->error = ret;
        btr_remove_node(&fn->btrn);
+       return ret;
 }
 
 static void wmadec_open(struct filter_node *fn)
@@ -1286,5 +1285,6 @@ void wmadec_filter_init(struct filter *f)
        f->close = wmadec_close;
        f->execute = wmadec_execute;
        f->pre_select = generic_filter_pre_select;
-       f->post_select = wmadec_post_select;
+       f->new_post_select = wmadec_post_select;
+       f->post_select = NULL;
 }