From a8e9ce1067c40f01d50e58d760c099ac98e9b12f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 2 Apr 2008 22:24:01 +0200 Subject: [PATCH] audiod: Fix decoder restart barrier. --- audiod.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/audiod.c b/audiod.c index 9d32e889..295c3755 100644 --- 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; } -- 2.39.5