summaryrefslogtreecommitdiffstats
path: root/src/pulse/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulse/context.c')
-rw-r--r--src/pulse/context.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 3b7bf08d..0c1810f3 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -64,6 +64,7 @@
#include <pulsecore/dynarray.h>
#include <pulsecore/socket-client.h>
#include <pulsecore/pstream-util.h>
+#include <pulsecore/core-rtclock.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/socket-util.h>
@@ -540,7 +541,7 @@ static void setup_context(pa_context *c, pa_iochannel *io) {
pa_pstream_set_recieve_memblock_callback(c->pstream, pstream_memblock_callback, c);
pa_assert(!c->pdispatch);
- c->pdispatch = pa_pdispatch_new(c->mainloop, command_table, PA_COMMAND_MAX);
+ c->pdispatch = pa_pdispatch_new(c->mainloop, c->use_rtclock, command_table, PA_COMMAND_MAX);
if (!c->conf->cookie_valid)
pa_log_info(_("No cookie loaded. Attempting to connect without."));
@@ -757,7 +758,7 @@ static void track_pulseaudio_on_dbus(pa_context *c, DBusBusType type, pa_dbus_wr
pa_assert(conn);
dbus_error_init(&error);
- if (!(*conn = pa_dbus_wrap_connection_new(c->mainloop, type, &error)) || dbus_error_is_set(&error)) {
+ if (!(*conn = pa_dbus_wrap_connection_new(c->mainloop, c->use_rtclock, type, &error)) || dbus_error_is_set(&error)) {
pa_log_warn("Unable to contact DBUS: %s: %s", error.name, error.message);
goto finish;
}
@@ -827,7 +828,7 @@ static int try_next_connection(pa_context *c) {
pa_xfree(c->server);
c->server = pa_xstrdup(u);
- if (!(c->client = pa_socket_client_new_string(c->mainloop, u, PA_NATIVE_DEFAULT_PORT)))
+ if (!(c->client = pa_socket_client_new_string(c->mainloop, c->use_rtclock, u, PA_NATIVE_DEFAULT_PORT)))
continue;
c->is_local = !!pa_socket_client_is_local(c->client);
@@ -1443,3 +1444,25 @@ finish:
if (pl)
pa_proplist_free(pl);
}
+
+pa_time_event* pa_context_rttime_new(pa_context *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata) {
+ struct timeval tv;
+
+ pa_assert(c);
+ pa_assert(c->mainloop);
+
+ pa_timeval_rtstore(&tv, usec, c->use_rtclock);
+
+ return c->mainloop->time_new(c->mainloop, &tv, cb, userdata);
+}
+
+void pa_context_rttime_restart(pa_context *c, pa_time_event *e, pa_usec_t usec) {
+ struct timeval tv;
+
+ pa_assert(c);
+ pa_assert(c->mainloop);
+
+ pa_timeval_rtstore(&tv, usec, c->use_rtclock);
+
+ c->mainloop->time_restart(e, &tv);
+}