Merge most of elmarco/rtclock2

Merge commit 'e4d914c945'
This commit is contained in:
Lennart Poettering 2009-06-22 23:09:46 +02:00
commit fc33f7ee97
56 changed files with 510 additions and 335 deletions

View file

@ -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;
}