]> git.tue.mpg.de Git - paraslash.git/commitdiff
audiod: Fix decoder restart barrier.
authorAndre Noll <maan@systemlinux.org>
Wed, 2 Apr 2008 20:24:01 +0000 (22:24 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 2 Apr 2008 20:24:01 +0000 (22:24 +0200)
audiod.c

index 9d32e889ea37364addb3258bd15458615e776a78..295c37553be11c9b72f2e9052f8fd77ab08e2296 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -338,35 +338,13 @@ static void open_writers(int slot_num)
        activate_inactive_grab_clients(slot_num, s->format, s->fc);
 }
 
-#if 0
-static void rn_event_handler(struct task *t)
-{
-       struct receiver_node *rn = t->private_data;
-       int i;
-
-       PARA_NOTICE_LOG("%s\n", para_strerror(-t->ret));
-       unregister_task(t);
-       rn->error = t->ret;
-       /* set restart barrier */
-       FOR_EACH_SLOT(i) {
-               struct timeval restart_delay = {0, 10 * 1000};
-               if (slot[i].receiver_node != rn)
-                       continue;
-               if (rn->error != -E_RECV_EOF)
-                       /* don't reconnect immediately on errors */
-                       restart_delay.tv_sec = 5;
-               tv_add(now, &restart_delay, &afi[slot[i].format].restart_barrier);
-       }
-}
-#endif
-
 static int open_receiver(int format)
 {
        struct audio_format_info *a = &afi[format];
        struct slot_info *s;
        int ret, slot_num;
        struct receiver_node *rn;
-       const struct timeval restart_delay = {1, 0};
+       const struct timeval restart_delay = {2, 0};
 
        ret = get_empty_slot();
        if (ret < 0)
@@ -390,9 +368,10 @@ static int open_receiver(int format)
        rn->task.post_select = a->receiver->post_select;
        sprintf(rn->task.status, "%s receiver node", rn->receiver->name);
        register_task(&rn->task);
-       return 1;
+       ret = 1;
 err:
-       PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+       if (ret < 0)
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        tv_add(now, &restart_delay, &afi[format].restart_barrier);
        return ret;
 }