]> git.tue.mpg.de Git - paraslash.git/commitdiff
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 cd43f24f47fa31beb27184a39f6dcd560fe3fb3e..22371f45f7ff18f8fcd6eb8474729586c4b26fbe 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;