From: Andre Date: Sat, 25 Mar 2006 19:06:37 +0000 (+0100) Subject: audiod: use set_restart_barrier() instead of duplicating it. X-Git-Tag: v0.2.12~140 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=dd172e4c54a6368087b183fd7d821862b038ea5f;p=paraslash.git audiod: use set_restart_barrier() instead of duplicating it. --- diff --git a/audiod.c b/audiod.c index cd43f24f..22371f45 100644 --- a/audiod.c +++ b/audiod.c @@ -448,6 +448,17 @@ static void kill_stream_writer(int slot_num) s->fci->error = 1; } +static void set_restart_barrier(int format, struct timeval *now) +{ + struct timeval tmp; + + if (now) + tmp = *now; + else + gettimeofday(&tmp, NULL); + tv_add(&tmp, &restart_delay, &afi[format].restart_barrier); +} + static void close_receiver(int slot_num) { struct slot_info *s = &slot[slot_num]; @@ -462,8 +473,7 @@ static void close_receiver(int slot_num) a->receiver->close(s->receiver_node); free(s->receiver_node); s->receiver_node = NULL; - gettimeofday(&now, NULL); - tv_add(&now, &restart_delay, &a->restart_barrier); /* FIXME: Use set_restart_barrier() */ + set_restart_barrier(s->format, NULL); } static void kill_all_decoders(void) @@ -477,17 +487,6 @@ static void kill_all_decoders(void) } } -static void set_restart_barrier(int format, struct timeval *now) -{ - struct timeval tmp; - - if (now) - tmp = *now; - else - gettimeofday(&tmp, NULL); - tv_add(&tmp, &restart_delay, &afi[format].restart_barrier); -} - static void check_sigchld(void) { pid_t pid;