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

index e1afff5..c849424 100644 (file)
@@ -37,7 +37,6 @@ static void prebuffer_pre_select(struct sched *s, struct task *t)
        struct prebuffer_filter_args_info *conf = ppd->conf;
        struct timeval diff;
 
-       t->error = 0;
        if (iqs == 0)
                return;
        if (ppd->barrier.tv_sec == 0) {
@@ -57,7 +56,7 @@ static void prebuffer_close(struct filter_node *fn)
        free(fn->private_data);
 }
 
-static void prebuffer_post_select(__a_unused struct sched *s, struct task *t)
+static int prebuffer_post_select(__a_unused struct sched *s, struct task *t)
 {
        struct filter_node *fn = container_of(t, struct filter_node, task);
        struct btr_node *btrn = fn->btrn;
@@ -65,15 +64,14 @@ static void prebuffer_post_select(__a_unused struct sched *s, struct task *t)
        struct private_prebuffer_data *ppd = fn->private_data;
        struct prebuffer_filter_args_info *conf = ppd->conf;
 
-       t->error = 0;
        if (ppd->barrier.tv_sec == 0)
-               return;
+               return 0;
        if (tv_diff(now, &ppd->barrier, NULL) < 0)
-               return;
+               return 0;
        if (iqs < conf->size_arg)
-               return;
-       btr_splice_out_node(btrn);
-       t->error = -E_PREBUFFER_SUCCESS;
+               return 0;
+       btr_splice_out_node(fn->btrn);
+       return -E_PREBUFFER_SUCCESS;
 }
 
 static int prebuffer_parse_config(int argc, char **argv, void **config)
@@ -124,7 +122,8 @@ void prebuffer_filter_init(struct filter *f)
        f->parse_config = prebuffer_parse_config;
        f->free_config = prebuffer_free_config;
        f->pre_select = prebuffer_pre_select;
-       f->post_select = prebuffer_post_select;
+       f->new_post_select = prebuffer_post_select;
+       f->post_select = NULL;
        f->help = (struct ggo_help) {
                .short_help = prebuffer_filter_args_info_help,
                .detailed_help = prebuffer_filter_args_info_detailed_help