chiark / gitweb /
Shun time(), since on Linux it is not monotonic with gettimeofday().
[disorder] / server / speaker.c
index 2206547674134ee3afd5c1b7c026919a98d329c6..892e33c960ceb631578d217d202724af22254dc2 100644 (file)
@@ -370,7 +370,7 @@ static void report(void) {
     strcpy(sm.id, playing->id);
     sm.data = playing->played / (uaudio_rate * uaudio_channels);
     speaker_send(1, &sm);
-    time(&last_report);
+    xtime(&last_report);
   }
 }
 
@@ -684,7 +684,7 @@ static void mainloop(void) {
       }
     }
     /* If we've not reported our state for a second do so now. */
-    if(force_report || time(0) > last_report)
+    if(force_report || xtime(0) > last_report)
       report();
   }
 }