audiod: use set_restart_barrier() instead of duplicating it.
authorAndre <maan@p133.(none)>
Sat, 25 Mar 2006 19:06:37 +0000 (20:06 +0100)
committerAndre <maan@p133.(none)>
Sat, 25 Mar 2006 19:06:37 +0000 (20:06 +0100)
audiod.c

index cd43f24..22371f4 100644 (file)
--- 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;