audiod: compute diff of server time and local time correctly
authorAndre <maan@p133.(none)>
Tue, 2 Jan 2007 23:15:17 +0000 (00:15 +0100)
committerAndre <maan@p133.(none)>
Tue, 2 Jan 2007 23:15:17 +0000 (00:15 +0100)
Current code misses to store the signum of the (average)
difference of server time and local time.

NEWS
audiod.c

diff --git a/NEWS b/NEWS
index 77399d2..6cc5052 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ NEWS
        - mp3dec: Fix decoding of corrupt mp3 files
        - para_audiod/para_filter: Fix a bug that caused the last chunk
          of audio data not being written under certain circumstances
+       - audiod: compute the difference of server time and local time
+         correctly
 
 -------------------------------------------
 0.2.14 (2006-10-15) "transient singularity"
index 40c7595..d17ec5e 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -493,7 +493,7 @@ static void compute_time_diff(const struct timeval *status_time)
                sa_time_diff_sign = sign;
                stat_task->sa_time_diff = diff;
                count++;
-               return;
+               goto out;
        }
        if (count > 5) {
                int s = tv_diff(&diff, &stat_task->sa_time_diff, &tmp);
@@ -513,6 +513,8 @@ static void compute_time_diff(const struct timeval *status_time)
                sa_time_diff_sign ? "+" : "-",
                tv2ms(&stat_task->sa_time_diff)
        );
+out:
+       stat_task->sa_time_diff_sign = sa_time_diff_sign;
 }
 
 static void check_stat_line(char *line)