From 43008575869cef8c49a4b9b967d7d10e66005174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20T=C3=B6rnblom?= Date: Thu, 6 Sep 2012 13:16:29 +0200 Subject: [PATCH] avoid kernel calls to read_hpet by replacing CLOCK_MONOTONIC with CLOCK_MONOTONIC_COARSE. This speeds up things a bit on low end devices (tested on WNR3500Lv2). --- src/rawtsinput.c | 2 +- src/tvheadend.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rawtsinput.c b/src/rawtsinput.c index 98e199a3..e22ac146 100644 --- a/src/rawtsinput.c +++ b/src/rawtsinput.c @@ -267,7 +267,7 @@ process_ts_packet(rawts_t *rt, uint8_t *tsb) slp.tv_sec = d / 1000000; slp.tv_nsec = (d % 1000000) * 1000; - clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &slp, NULL); + clock_nanosleep(CLOCK_MONOTONIC_COARSE, TIMER_ABSTIME, &slp, NULL); didsleep = 1; } t->s_pcr_last = pcr; diff --git a/src/tvheadend.h b/src/tvheadend.h index 8d86ba51..b66ba756 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -390,7 +390,7 @@ getmonoclock(void) { struct timespec tp; - clock_gettime(CLOCK_MONOTONIC, &tp); + clock_gettime(CLOCK_MONOTONIC_COARSE, &tp); return tp.tv_sec * 1000000ULL + (tp.tv_nsec / 1000); }