The opus audio format handler.
[paraslash.git] / dccp_recv.c
index 4151853947bc0f3069fad111c2bdb25fec3ef468..1f9df18955306c2c2449444f3c5a0317d1358a4b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 #include "list.h"
 #include "sched.h"
 #include "ggo.h"
+#include "buffer_tree.h"
 #include "recv.h"
 #include "string.h"
 #include "net.h"
 #include "fd.h"
-#include "buffer_tree.h"
 
 #include "dccp_recv.cmdline.h"
 
@@ -124,7 +124,7 @@ static void dccp_recv_pre_select(struct sched *s, struct task *t)
        para_fd_set(rn->fd, &s->rfds, &s->max_fileno);
 }
 
-static void dccp_recv_post_select(struct sched *s, struct task *t)
+static int dccp_recv_post_select(struct sched *s, struct task *t)
 {
        struct receiver_node *rn = container_of(t, struct receiver_node, task);
        struct btr_node *btrn = rn->btrn;
@@ -132,6 +132,9 @@ static void dccp_recv_post_select(struct sched *s, struct task *t)
        int ret, iovcnt;
        size_t num_bytes;
 
+       ret = task_get_notification(t);
+       if (ret < 0)
+               goto out;
        ret = btr_node_status(btrn, 0, BTR_NT_ROOT);
        if (ret <= 0)
                goto out;
@@ -149,10 +152,9 @@ static void dccp_recv_post_select(struct sched *s, struct task *t)
                btr_add_output_pool(rn->btrp, num_bytes - iov[0].iov_len, btrn);
        }
 out:
-       if (ret >= 0)
-               return;
-       btr_remove_node(rn->btrn);
-       t->error = ret;
+       if (ret < 0)
+               btr_remove_node(&rn->btrn);
+       return ret;
 }
 
 static void dccp_recv_free_config(void *conf)