]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
use CLOCK_REALTIME if alsa is earlier than 1.0.28
authorMike Brady <mikebrady@eircom.net>
Sun, 17 Feb 2019 13:52:38 +0000 (13:52 +0000)
committerMike Brady <mikebrady@eircom.net>
Sun, 17 Feb 2019 13:52:38 +0000 (13:52 +0000)
audio_alsa.c

index 2b8d204588bdbb7557c933def3a9296c48893e61..01882639acf7c9b7a531d31de8570a1b78563e74 100644 (file)
@@ -1158,7 +1158,12 @@ int delay_and_status(snd_pcm_state_t *state, snd_pcm_sframes_t *delay) {
       if (*state == SND_PCM_STATE_DRAINING)
         debug(1, "alsa: draining with a delay of %d.", delay);
 
+#if SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR < 28
       clock_gettime(CLOCK_REALTIME, &tn);
+#else
+      clock_gettime(CLOCK_MONOTONIC, &tn);
+#endif
+    
       uint64_t time_now_ns = tn.tv_sec * (uint64_t)1000000000 + tn.tv_nsec;
       uint64_t update_timestamp_ns =
           update_timestamp.tv_sec * (uint64_t)1000000000 + update_timestamp.tv_nsec;