From: Lennart Poettering Date: Thu, 19 Feb 2009 03:00:29 +0000 (+0100) Subject: add pa_timespec_load X-Git-Tag: 1.0_branch~2113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cbdd3a968cc167ca7f0060089efc69c4c2c1f13;p=profile%2Fivi%2Fpulseaudio.git add pa_timespec_load --- diff --git a/src/pulsecore/rtclock.c b/src/pulsecore/rtclock.c index 5fc6da2..dcbd118 100644 --- a/src/pulsecore/rtclock.c +++ b/src/pulsecore/rtclock.c @@ -141,3 +141,11 @@ struct timeval* pa_rtclock_from_wallclock(struct timeval *tv) { return tv; } + +pa_usec_t pa_timespec_load(const struct timespec *ts) { + pa_assert(ts); + + return + (pa_usec_t) ts->tv_sec * PA_USEC_PER_SEC + + (pa_usec_t) ts->tv_nsec / PA_NSEC_PER_USEC; +} diff --git a/src/pulsecore/rtclock.h b/src/pulsecore/rtclock.h index 281461d..03cc1c7 100644 --- a/src/pulsecore/rtclock.h +++ b/src/pulsecore/rtclock.h @@ -42,4 +42,6 @@ void pa_rtclock_hrtimer_enable(void); struct timeval* pa_rtclock_from_wallclock(struct timeval *tv); +pa_usec_t pa_timespec_load(const struct timespec *ts); + #endif