From 681798711620ce23ae17b08673fbe14355338f83 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 30 Aug 2007 22:39:47 +0000 Subject: add pa_timespec_reset() git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1726 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/rtclock.c | 7 +++++++ src/pulsecore/rtclock.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/pulsecore/rtclock.c b/src/pulsecore/rtclock.c index 507b8999..a4e9875d 100644 --- a/src/pulsecore/rtclock.c +++ b/src/pulsecore/rtclock.c @@ -46,6 +46,13 @@ struct timespec *pa_timespec_store(struct timespec *a, pa_usec_t u) { return a; } +struct timespec *pa_timespec_reset(struct timespec *a) { + pa_assert(a); + + a->tv_sec = a->tv_nsec = 0; + return a; +} + pa_usec_t pa_timespec_load(struct timespec *ts) { pa_assert(ts); diff --git a/src/pulsecore/rtclock.h b/src/pulsecore/rtclock.h index 145533cd..cfc968f8 100644 --- a/src/pulsecore/rtclock.h +++ b/src/pulsecore/rtclock.h @@ -37,6 +37,7 @@ pa_usec_t pa_rtclock_age(const struct timespec *tv); int pa_rtclock_hrtimer(void); struct timespec *pa_timespec_store(struct timespec *a, pa_usec_t u); +struct timespec *pa_timespec_reset(struct timespec *a); pa_usec_t pa_timespec_load(struct timespec *tv); struct timespec *pa_timespec_add(struct timespec *tv, pa_usec_t t); pa_usec_t pa_timespec_diff(const struct timespec *a, const struct timespec *b); -- cgit