integrate writers into para_audiod
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index b692ac5..2efe07c 100644 (file)
--- a/write.c
+++ b/write.c
@@ -161,6 +161,17 @@ out:
        return NULL;
 }
 
+static void wng_event_handler(struct task *t)
+{
+       struct writer_node_group *g = t->private_data;
+
+       PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
+       unregister_task(t);
+       wng_close(g);
+       wng_destroy(g);
+}
+
+
 static void idt_event_handler(struct task *t)
 {
        int ret;
@@ -170,6 +181,7 @@ static void idt_event_handler(struct task *t)
        wng->buf = sit.buf;
        wng->loaded = &sit.loaded;
        wng->input_eof = &sit.eof;
+       wng->task.event_handler = wng_event_handler;
        ret = wng_open(wng);
        if (ret < 0) {
                PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));