summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-22 23:49:40 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-22 23:49:40 +0200
commitf753ef2a23c0c42e5ad35a36327a9fda2e4f2d98 (patch)
tree64b99676ac87de226051aaa5f6a05a890db7c22c /src
parent3ee29004a9f5980b06647c5ba66a791f41390929 (diff)
rtclock: enable rtclock for our own mainloop implementations
Diffstat (limited to 'src')
-rw-r--r--src/pulse/context.c1
-rw-r--r--src/pulse/internal.h2
-rw-r--r--src/pulse/mainloop.c15
3 files changed, 14 insertions, 4 deletions
diff --git a/src/pulse/context.c b/src/pulse/context.c
index b71659de2..505e758a9 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -160,6 +160,7 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
c->playback_streams = pa_dynarray_new();
c->record_streams = pa_dynarray_new();
c->client_index = PA_INVALID_INDEX;
+ c->use_rtclock = pa_mainloop_is_our_api(mainloop);
PA_LLIST_HEAD_INIT(pa_stream, c->streams);
PA_LLIST_HEAD_INIT(pa_operation, c->operations);
diff --git a/src/pulse/internal.h b/src/pulse/internal.h
index fa5efd7dc..ec2da85be 100644
--- a/src/pulse/internal.h
+++ b/src/pulse/internal.h
@@ -280,4 +280,6 @@ pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *ta
void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
+pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m);
+
#endif
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index 5d0e0ffc1..c418d1086 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -56,6 +56,7 @@
#include <pulsecore/macro.h>
#include "mainloop.h"
+#include "internal.h"
struct pa_io_event {
pa_mainloop *mainloop;
@@ -456,10 +457,10 @@ static void mainloop_quit(pa_mainloop_api*a, int retval) {
static const pa_mainloop_api vtable = {
.userdata = NULL,
- .io_new= mainloop_io_new,
- .io_enable= mainloop_io_enable,
- .io_free= mainloop_io_free,
- .io_set_destroy= mainloop_io_set_destroy,
+ .io_new = mainloop_io_new,
+ .io_enable = mainloop_io_enable,
+ .io_free = mainloop_io_free,
+ .io_set_destroy = mainloop_io_set_destroy,
.time_new = mainloop_time_new,
.time_restart = mainloop_time_restart,
@@ -994,3 +995,9 @@ void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *use
m->poll_func = poll_func;
m->poll_func_userdata = userdata;
}
+
+pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m) {
+ pa_assert(m);
+
+ return m->io_new == mainloop_io_new;
+}