use CLOCK_REALTIME if alsa is earlier than 1.0.28
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user