From: Andre Date: Mon, 3 Apr 2006 14:09:57 +0000 (+0200) Subject: Fix use of uninitialized variable 'now' in afs_preselect() X-Git-Tag: v0.2.12~116 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f7212adf2159341127331436d2ddc9e1f7a21563 Fix use of uninitialized variable 'now' in afs_preselect() --- diff --git a/afs.c b/afs.c index a73b18e0..6dac43d7 100644 --- a/afs.c +++ b/afs.c @@ -313,7 +313,7 @@ static struct timeval *afs_compute_timeout(void) if (chk_barrier("eof", &now, &eof_barrier, &the_timeout, 1) < 0) return &the_timeout; if (chk_barrier("data send", &now, &data_send_barrier, - &the_timeout, 1) < 0) + &the_timeout, 1) < 0) return &the_timeout; if (mmd->audio_format < 0 || !afs_playing() || !audio_file) return NULL; @@ -398,10 +398,9 @@ again: senders[i].shutdown_clients(); if (af) { struct timeval now; - if (!afs_paused() || mmd->chunks_sent) { - gettimeofday(&now, NULL); + gettimeofday(&now, NULL); + if (!afs_paused() || mmd->chunks_sent) tv_add(&af->eof_tv, &now, &eof_barrier); - } if (afs_repos()) tv_add(&now, &announce_tv, &data_send_barrier); if (mmd->new_afs_status_flags & AFS_NOMORE) @@ -415,7 +414,7 @@ again: mmd->new_afs_status_flags &= ~(AFS_REPOS); mmd->current_chunk = mmd->repos_request; } - ret = afs_compute_timeout(); + ret = afs_compute_timeout(); if (!ret && !audio_file && afs_playing() && !(mmd->new_afs_status_flags & AFS_NOMORE)) { PARA_DEBUG_LOG("%s", "ready and playing, but no audio file\n");