audiod: Kill noisy debug message.
[paraslash.git] / wmadec_filter.c
index 214ceb1..49f69b5 100644 (file)
@@ -1230,19 +1230,21 @@ static int wmadec_execute(struct btr_node *btrn, const char *cmd, char **result)
 static void 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 = 0;
+       int ret, converted;
        struct private_wmadec_data *pwd = fn->private_data;
        struct btr_node *btrn = fn->btrn;
        size_t len;
        char *in;
 
 next_buffer:
+       converted = 0;
        t->error = 0;
-       ret = prepare_filter_node(fn);
+       ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
        if (ret < 0)
                goto err;
        if (ret == 0)
                return;
+       btr_merge(btrn, fn->min_iqs);
        len = btr_next_buffer(btrn, (char **)&in);
        ret = -E_WMADEC_EOF;
        if (len < fn->min_iqs)
@@ -1263,7 +1265,7 @@ next_buffer:
        for (;;) {
                char *out;
                int out_size = WMA_OUTPUT_BUFFER_SIZE;
-               if (converted + WMA_FRAME_SKIP + pwd->ahi.block_align > len)
+               if (converted + fn->min_iqs > len)
                        break;
                out = para_malloc(WMA_OUTPUT_BUFFER_SIZE);
                ret = wma_decode_superframe(pwd, out,
@@ -1281,9 +1283,8 @@ success:
        goto next_buffer;
 err:
        assert(ret < 0);
-       wmadec_close(fn);
        t->error = ret;
-       btr_del_node(btrn);
+       btr_remove_node(btrn);
 }
 
 static ssize_t wmadec_convert(char *inbuffer, size_t len,