mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
rtclock: enable rtclock for our own mainloop implementations
This commit is contained in:
parent
3ee29004a9
commit
f753ef2a23
3 changed files with 14 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue