diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-06-22 23:09:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-06-22 23:09:46 +0200 |
commit | fc33f7ee97da6a8b7263620775b7b74b4c754402 (patch) | |
tree | 519635b1f72acc7613b4b7c4ad70fbc39ab3901b /src/modules/module-esound-sink.c | |
parent | 048e576a6dfe2bfe62fa33c74c30cc34057ee740 (diff) | |
parent | e4d914c945c13d23b131d7ba75fbdd03cb6d0043 (diff) |
Merge most of elmarco/rtclock2
Merge commit 'e4d914c945c13d23b131d7ba75fbdd03cb6d0043'
Diffstat (limited to 'src/modules/module-esound-sink.c')
-rw-r--r-- | src/modules/module-esound-sink.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c index 48a9c7947..d7c678ca9 100644 --- a/src/modules/module-esound-sink.c +++ b/src/modules/module-esound-sink.c @@ -41,13 +41,15 @@ #include <linux/sockios.h> #endif -#include <pulse/xmalloc.h> +#include <pulse/rtclock.h> #include <pulse/timeval.h> +#include <pulse/xmalloc.h> #include <pulsecore/core-error.h> #include <pulsecore/iochannel.h> #include <pulsecore/sink.h> #include <pulsecore/module.h> +#include <pulsecore/core-rtclock.h> #include <pulsecore/core-util.h> #include <pulsecore/modargs.h> #include <pulsecore/log.h> @@ -57,7 +59,6 @@ #include <pulsecore/thread-mq.h> #include <pulsecore/thread.h> #include <pulsecore/time-smoother.h> -#include <pulsecore/rtclock.h> #include <pulsecore/socket-util.h> #include "module-esound-sink-symdef.h" @@ -145,14 +146,14 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse case PA_SINK_SUSPENDED: pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state)); - pa_smoother_pause(u->smoother, pa_rtclock_usec()); + pa_smoother_pause(u->smoother, pa_rtclock_now()); break; case PA_SINK_IDLE: case PA_SINK_RUNNING: if (u->sink->thread_info.state == PA_SINK_SUSPENDED) - pa_smoother_resume(u->smoother, pa_rtclock_usec(), TRUE); + pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE); break; @@ -167,7 +168,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse case PA_SINK_MESSAGE_GET_LATENCY: { pa_usec_t w, r; - r = pa_smoother_get(u->smoother, pa_rtclock_usec()); + r = pa_smoother_get(u->smoother, pa_rtclock_now()); w = pa_bytes_to_usec((uint64_t) u->offset + u->memchunk.length, &u->sink->sample_spec); *((pa_usec_t*) data) = w > r ? w - r : 0; @@ -201,7 +202,7 @@ static void thread_func(void *userdata) { pa_thread_mq_install(&u->thread_mq); - pa_smoother_set_time_offset(u->smoother, pa_rtclock_usec()); + pa_smoother_set_time_offset(u->smoother, pa_rtclock_now()); for (;;) { int ret; @@ -294,7 +295,7 @@ static void thread_func(void *userdata) { else usec = 0; - pa_smoother_put(u->smoother, pa_rtclock_usec(), usec); + pa_smoother_put(u->smoother, pa_rtclock_now(), usec); } /* Hmm, nothing to do. Let's sleep */ @@ -607,7 +608,7 @@ int pa__init(pa_module*m) { pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq); pa_sink_set_rtpoll(u->sink, u->rtpoll); - if (!(u->client = pa_socket_client_new_string(u->core->mainloop, espeaker, ESD_DEFAULT_PORT))) { + if (!(u->client = pa_socket_client_new_string(u->core->mainloop, TRUE, espeaker, ESD_DEFAULT_PORT))) { pa_log("Failed to connect to server."); goto fail; } |