mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-12 13:30:10 -05:00
Monotonic clock is optional so treat is as such.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1780 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
717b164161
commit
e1766011ca
1 changed files with 5 additions and 1 deletions
|
|
@ -139,9 +139,11 @@ struct timespec *pa_rtclock_get(struct timespec *ts) {
|
|||
pa_assert(ts);
|
||||
|
||||
if (!no_monotonic) {
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
if (clock_gettime(CLOCK_MONOTONIC, ts) >= 0)
|
||||
return ts;
|
||||
|
||||
#endif
|
||||
|
||||
no_monotonic = 1;
|
||||
}
|
||||
|
||||
|
|
@ -152,8 +154,10 @@ struct timespec *pa_rtclock_get(struct timespec *ts) {
|
|||
int pa_rtclock_hrtimer(void) {
|
||||
struct timespec ts;
|
||||
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
if (clock_getres(CLOCK_MONOTONIC, &ts) >= 0)
|
||||
return ts.tv_sec == 0 && ts.tv_nsec <= PA_HRTIMER_THRESHOLD_USEC*1000;
|
||||
#endif
|
||||
|
||||
pa_assert_se(clock_getres(CLOCK_REALTIME, &ts) == 0);
|
||||
return ts.tv_sec == 0 && ts.tv_nsec <= PA_HRTIMER_THRESHOLD_USEC*1000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue