diff options
author | João Paulo Rechi Vita <joao.vita@gmail.com> | 2008-08-11 22:54:09 -0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-09-11 01:12:04 +0300 |
commit | f992296b9763ceef1f2f013a89b98fe3e68366d5 (patch) | |
tree | ad4cce899a768989b0d9be62ca849135ebd94768 /src | |
parent | 255f9b0fe65631815895c7a2c0c4dd6752ec23f3 (diff) |
Hand the stream socket to the rt thread
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/module-bt-device.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/modules/module-bt-device.c b/src/modules/module-bt-device.c index c0ca6375..da2fa337 100644 --- a/src/modules/module-bt-device.c +++ b/src/modules/module-bt-device.c @@ -113,6 +113,10 @@ static const char* const valid_modargs[] = { NULL }; +enum { + SINK_MESSAGE_PASS_SOCKET = PA_SINK_MESSAGE_MAX +}; + static int bt_audioservice_send(int sk, const bt_audio_msg_header_t *msg) { int e; pa_log/*_debug*/("sending %s", bt_audio_strmsg(msg->msg_type)); @@ -545,15 +549,15 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse break; } -// case SINK_MESSAGE_PASS_SOCKET: { -// struct pollfd *pollfd; -// pa_assert(!u->rtpoll_item); -// u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1); -// pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL); -// pollfd->fd = u->fd; -// pollfd->events = pollfd->revents = 0; -// return 0; -// } + case SINK_MESSAGE_PASS_SOCKET: { + struct pollfd *pollfd; + pa_assert(!u->rtpoll_item); + u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1); + pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL); + pollfd->fd = u->stream_fd; + pollfd->events = pollfd->revents = 0; + return 0; + } } return pa_sink_process_msg(o, code, data, offset, chunk); @@ -809,6 +813,9 @@ int pa__init(pa_module* m) { } pa_sink_put(u->sink); + /* hand the socket to the rt thread */ + pa_asyncmsgq_post(u->thread_mq.inq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_PASS_SOCKET, NULL, 0, NULL, NULL); + pa_modargs_free(ma); return 0; |