summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-08-30 22:39:47 +0000
committerLennart Poettering <lennart@poettering.net>2007-08-30 22:39:47 +0000
commit681798711620ce23ae17b08673fbe14355338f83 (patch)
tree215e4daed6e1dc5f3394c69f0823cd146e43a1f3
parent747b01be9430f82ffec0d4e726d64bb83ded3f77 (diff)
add pa_timespec_reset()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1726 fefdeb5f-60dc-0310-8127-8f9354f1896f
-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);