mirror of https://github.com/ericonr/sndio.git
Don't calculate clock deltas is there are no time-outs. Removes (harmless)
warnings about out-of-bounds clock deltas.
This commit is contained in:
parent
aa4fc43964
commit
3b3a64a4fc
|
@ -413,21 +413,21 @@ file_poll(void)
|
||||||
file_wtime += 1000000000LL * (ts.tv_sec - sleepts.tv_sec);
|
file_wtime += 1000000000LL * (ts.tv_sec - sleepts.tv_sec);
|
||||||
file_wtime += ts.tv_nsec - sleepts.tv_nsec;
|
file_wtime += ts.tv_nsec - sleepts.tv_nsec;
|
||||||
#endif
|
#endif
|
||||||
delta_nsec = 1000000000LL * (ts.tv_sec - file_ts.tv_sec);
|
|
||||||
delta_nsec += ts.tv_nsec - file_ts.tv_nsec;
|
|
||||||
#ifdef DEBUG
|
|
||||||
if (delta_nsec < 0)
|
|
||||||
log_puts("file_poll: negative time interval\n");
|
|
||||||
#endif
|
|
||||||
file_ts = ts;
|
|
||||||
if (timo_queue) {
|
if (timo_queue) {
|
||||||
|
delta_nsec = 1000000000LL * (ts.tv_sec - file_ts.tv_sec);
|
||||||
|
delta_nsec += ts.tv_nsec - file_ts.tv_nsec;
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (delta_nsec < 0)
|
||||||
|
log_puts("file_poll: negative time interval\n");
|
||||||
|
#endif
|
||||||
if (delta_nsec >= 0 && delta_nsec < 1000000000LL)
|
if (delta_nsec >= 0 && delta_nsec < 1000000000LL)
|
||||||
timo_update(delta_nsec / 1000);
|
timo_update(delta_nsec / 1000);
|
||||||
else {
|
else {
|
||||||
if (log_level >= 2)
|
if (log_level >= 2)
|
||||||
log_puts("ignored huge clock delta\n");
|
log_puts("out-of-bounds clock delta\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_ts = ts;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* process files that rely on poll
|
* process files that rely on poll
|
||||||
|
|
Loading…
Reference in New Issue