summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pulsecore/rtclock.c7
-rw-r--r--src/pulsecore/rtclock.h1
2 files changed, 8 insertions, 0 deletions
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);