]> git.tue.mpg.de Git - paraslash.git/commitdiff
btr_slice_out_node() cleanup.
authorAndre Noll <maan@systemlinux.org>
Thu, 31 Dec 2009 04:27:38 +0000 (05:27 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 31 Dec 2009 04:27:38 +0000 (05:27 +0100)
buffer_tree.c
buffer_tree.h
wav_filter.c

index 1bc9529884dc16b779ee232022e6bb37ccee0e2d..b7420ebeeb38e70f85ad4c9f34fa215b59504f61 100644 (file)
@@ -225,15 +225,13 @@ size_t btr_get_input_queue_size(struct btr_node *btrn)
        return size;
 }
 
-int btr_splice_out_node(struct btr_node *btrn)
+void btr_splice_out_node(struct btr_node *btrn)
 {
        struct btr_node *ch, *tmp;
 
-       if (!btrn)
-               return -ERRNO_TO_PARA_ERROR(EINVAL);
-       if (btr_get_input_queue_size(btrn) != 0)
-               return -ERRNO_TO_PARA_ERROR(EINVAL);
+       assert(btrn);
        PARA_NOTICE_LOG("splicing out %s\n", btrn->name);
+       btr_pushdown(btrn);
        if (btrn->parent)
                list_del(&btrn->node);
        FOR_EACH_CHILD_SAFE(ch, tmp, btrn) {
index 927d3b6731197bc02260ece8e0cfdea9406d7544..468b10d1d5a5c9ffaf815e14431baa56d6dcfe04 100644 (file)
@@ -16,7 +16,7 @@ size_t btr_next_buffer(struct btr_node *btrn, char **bufp);
 void btr_consume(struct btr_node *btrn, size_t numbytes);
 int btr_exec(struct btr_node *btrn, const char *command, char **value_result);
 int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result);
-int btr_splice_out_node(struct btr_node *btrn);
+void btr_splice_out_node(struct btr_node *btrn);
 void btr_pushdown(struct btr_node *btrn);
 void *btr_context(struct btr_node *btrn);
 int btr_merge(struct btr_node *btrn);
index 7a3c59bfbe9faec0354317bc6c6055ca975b7eeb..91d87e7ae03d6086c0db7e152b389eba3f6dbee7 100644 (file)
@@ -147,13 +147,12 @@ static void wav_post_select(__a_unused struct sched *s, struct task *t)
        header = para_malloc(WAV_HEADER_LEN);
        make_wav_header(ch, rate, header);
        btr_add_output(header, WAV_HEADER_LEN, btrn);
-       btr_pushdown(btrn);
        ret = -E_WAV_SUCCESS;
 err:
        t->error = ret;
        wav_close(fn);
        if (ret == -E_WAV_SUCCESS)
-               ret = btr_splice_out_node(btrn);
+               btr_splice_out_node(btrn);
        else {
                btr_del_node(btrn);
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));