]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
resample: Switch to the alternative post select method.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 13:34:37 +0000 (13:34 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:45 +0000 (14:12 +0200)
resample_filter.c

index ed9945aecf30492b296d004d732cc23b5cc4ba86..383332b2e2d2de9c82f96fe0b81b69a6081a746f 100644 (file)
@@ -202,7 +202,7 @@ static int resample_frames(int16_t *in, size_t num_frames, bool have_more,
        return data.input_frames_used;
 }
 
-static void resample_post_select(__a_unused struct sched *s, struct task *t)
+static int resample_post_select(__a_unused struct sched *s, struct task *t)
 {
        int ret;
        struct filter_node *fn = container_of(t, struct filter_node, task);
@@ -231,7 +231,8 @@ static void resample_post_select(__a_unused struct sched *s, struct task *t)
                 * btr exec mechanism for the destination samplerate and the
                 * channel count.
                 */
-               return btr_pushdown(btrn);
+               btr_pushdown(btrn);
+               return 0;
        }
        btr_merge(btrn, fn->min_iqs);
        in_bytes = btr_next_buffer(btrn, (char **)&in);
@@ -246,14 +247,14 @@ static void resample_post_select(__a_unused struct sched *s, struct task *t)
                goto out;
        btr_consume(btrn, ret * 2 * ctx->channels);
        btr_add_output((char *)out, num_frames * 2 * ctx->channels, btrn);
-       return;
+       return 0;
 out:
        if (ret < 0) {
-               t->error = ret;
                btr_remove_node(&fn->btrn);
                /* This releases the check_wav btr node */
                check_wav_post_select(ctx->cwc);
        }
+       return ret;
 }
 
 static int resample_parse_config(int argc, char **argv, void **config)
@@ -305,7 +306,8 @@ void resample_filter_init(struct filter *f)
        f->close = resample_close;
        f->open = resample_open;
        f->pre_select = resample_pre_select;
-       f->post_select = resample_post_select;
+       f->new_post_select = resample_post_select;
+       f->post_select = NULL;
        f->parse_config = resample_parse_config;
        f->free_config = resample_free_config;
        f->execute = resample_execute;