]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod.c
audiod: Add a paranoia check to close_writers().
[paraslash.git] / audiod.c
index 2819091b80a2c27991df0ae0f3a95290e7423916..4b2c65f7a48e381ea016f4f8276b15c2e1766f1d 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -357,6 +357,7 @@ static void close_writers(struct slot_info *s)
 
        if (s->format < 0)
                return;
+       assert(s->wns);
        a = afi + s->format;
        if (a->num_writers == 0)
                writer_cleanup(s->wns);
@@ -479,7 +480,11 @@ static void open_filters(struct slot_info *s)
                fn->conf = a->filter_conf[i];
                fn->task.pre_select = f->pre_select;
                fn->task.post_select = f->post_select;
-               fn->btrn = btr_new_node(f->name, parent, f->execute, fn);
+
+               fn->btrn = btr_new_node(&(struct btr_node_description)
+                       EMBRACE(.name = f->name, .parent = parent,
+                               .handler = f->execute, .context = fn));
+
                f->open(fn);
                register_task(&fn->task);
                parent = fn->btrn;
@@ -532,7 +537,8 @@ static int open_receiver(int format)
        rn = s->receiver_node;
        rn->receiver = r;
        rn->conf = a->receiver_conf;
-       rn->btrn = btr_new_node(r->name, NULL, NULL, rn);
+       rn->btrn = btr_new_node(&(struct btr_node_description)
+               EMBRACE(.name = r->name, .context = rn));
        ret = r->open(rn);
        if (ret < 0) {
                btr_free_node(rn->btrn);