From 8de17dbed0354e6e3475defec2fb046a559f1c47 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Tue, 12 Jun 2007 18:33:26 +0000 Subject: Use <= when comparing (current time - start time) to a timeout. This way if the clock ticks right after we get the start time and the timeout is only one second, we'll still wait a full second instead of returning immediately. git-svn-id: https://svn.musicpd.org/mpd/trunk@6557 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audioOutputs/audioOutput_shout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c index 5444912c5..3bc8bb456 100644 --- a/src/audioOutputs/audioOutput_shout.c +++ b/src/audioOutputs/audioOutput_shout.c @@ -453,7 +453,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput) int state; if (sd->connAttempts != 0 && - (t - sd->lastAttempt) < CONN_ATTEMPT_INTERVAL) { + (t - sd->lastAttempt) <= CONN_ATTEMPT_INTERVAL) { return -1; } @@ -462,7 +462,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput) state = shout_open(sd->shoutConn); - while (state == SHOUTERR_BUSY && (t - sd->lastAttempt) < sd->timeout) { + while (state == SHOUTERR_BUSY && (t - sd->lastAttempt) <= sd->timeout) { my_usleep(10000); state = shout_get_connected(sd->shoutConn); t = time(NULL); -- cgit v1.2.3