]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod.c
audiod: Don't open the receiver too early.
[paraslash.git] / audiod.c
index e950dedea157d3b4a6e6202814315a0b813862e8..d12b65e5a49193346adc798be3b28293e16bb99c 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -600,12 +600,14 @@ static int open_current_receiver(struct sched *s)
                 * this period begins to avoid restarting the receiver that
                 * belongs to the file just completed.
                 */
-               if (stat_task->server_stream_start.tv_sec != 0)
+               if (stat_task->server_stream_start.tv_sec != 0) {
                        sched_request_timeout_ms(100, s);
+                       return -1;
+               }
        }
        if (tv_diff(now, &afi[cafn].restart_barrier, &diff) < 0) {
                if (tv_diff(&s->timeout, &diff, NULL) > 0)
-                       s->timeout = diff;
+                       sched_request_timeout(&diff, s);
                else
                        sched_min_delay(s);
                return -1;