From a94872914afe2e9cc96bb9f8f931a34fb471bb11 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 12 Jan 2010 00:59:16 +0100 Subject: [PATCH] audiod: Don't open the receiver too early. Also use sched_request_timeout() instead of setting the timeout directly. --- audiod.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/audiod.c b/audiod.c index e950dede..d12b65e5 100644 --- 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; -- 2.30.2