From 5dcdd5e3583f32c8bffb5a1892e318747070f5d8 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sat, 4 Apr 2009 22:56:38 +0300 Subject: perl -p -i -e 's/pa_rtclock_usec/pa_rtclock_now/g' `find . -name '*.[ch]'` --- src/daemon/cpulimit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index 45d6a0fb..e9cefdcc 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -125,7 +125,7 @@ static void signal_handler(int sig) { char t[256]; #endif - now = pa_rtclock_usec(); + now = pa_rtclock_now(); elapsed = now - last_time; #ifdef PRINT_CPU_LOAD @@ -184,7 +184,7 @@ int pa_cpu_limit_init(pa_mainloop_api *m) { pa_assert(the_pipe[1] == -1); pa_assert(!installed); - last_time = pa_rtclock_usec(); + last_time = pa_rtclock_now(); /* Prepare the main loop pipe */ if (pipe(the_pipe) < 0) { -- cgit From 125c52889626b2ac408ecbcc8ea85575f5808e07 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sat, 4 Apr 2009 23:19:53 +0300 Subject: pulse: move pa_rtclock_now in pulsecommon --- src/daemon/cpulimit.c | 3 ++- src/daemon/main.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index e9cefdcc..c2877ecf 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -24,13 +24,14 @@ #endif #include +#include #include +#include #include #include #include #include -#include #include "cpulimit.h" diff --git a/src/daemon/main.c b/src/daemon/main.c index 8058e122..083e4eae 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -85,7 +86,6 @@ #include #include #include -#include #include #include #include -- cgit From 0955e3d45b6e992308e2d51fcbf28a9f9376f788 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sun, 5 Apr 2009 02:13:43 +0300 Subject: Base mainloop on pa_rtclock_now() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the mainloop to monotonic based time events. Introduces 4 helper functions: pa_{context,core}_rttime_{new,restart}(), that fill correctly a timeval with the rtclock flag set if the mainloop supports it. Both mainloop-test and mainloop-test-glib works with rt and timeval based time events. PulseAudio and clients should be fully functional. This patch has received several iterations, and this one as been largely untested. Signed-off-by: Marc-André Lureau --- src/daemon/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/main.c b/src/daemon/main.c index 083e4eae..399034e9 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -133,7 +133,7 @@ static void message_cb(pa_mainloop_api*a, pa_time_event*e, const struct timeval } pa_timeval_add(pa_gettimeofday(&tvnext), 100000); - a->time_restart(e, &tvnext); + a->rtclock_time_restart(e, &tvnext); } #endif @@ -1018,7 +1018,7 @@ int main(int argc, char *argv[]) { #endif #ifdef OS_IS_WIN32 - win32_timer = pa_mainloop_get_api(mainloop)->time_new(pa_mainloop_get_api(mainloop), pa_gettimeofday(&win32_tv), message_cb, NULL); + win32_timer = pa_mainloop_get_api(mainloop)->rtclock_time_new(pa_mainloop_get_api(mainloop), pa_gettimeofday(&win32_tv), message_cb, NULL); #endif oil_init(); -- cgit