diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-09-14 21:51:05 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-09-14 21:51:05 +0000 |
commit | 3396b65f15a06ff312e318bc05e502ba402c564e (patch) | |
tree | 5087148cbe36f765f9fff99528d812c198799c63 /src/modules/module-oss.c | |
parent | f0b9dce32e4c5d77f57364ccdc7795f828f7f6a0 (diff) |
simplify rt loops a bit by moving more code into pa_rtpoll. It is now possible to attach "work" functions to a pa_rtpoll_item, which will be called in each loop iteration. This allows us to hide the message processing in the RT loops and to drop the seperate sink_input->process hooks. Basically, only the driver-specific code remains in the RT loops.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1822 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-oss.c')
-rw-r--r-- | src/modules/module-oss.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/src/modules/module-oss.c b/src/modules/module-oss.c index 1fd8d2e5..037c4017 100644 --- a/src/modules/module-oss.c +++ b/src/modules/module-oss.c @@ -999,28 +999,6 @@ static void thread_func(void *userdata) { /* pa_log("loop2"); */ - /* Now give the sink inputs some to time to process their data */ - if (u->sink) { - if ((ret = pa_sink_process_inputs(u->sink)) < 0) - goto fail; - if (ret > 0) - continue; - } - - /* Now give the source outputs some to time to process their data */ - if (u->source) { - if ((ret = pa_source_process_outputs(u->source)) < 0) - goto fail; - if (ret > 0) - continue; - } - - /* Check whether there is a message for us to process */ - if ((ret = pa_thread_mq_process(&u->thread_mq) < 0)) - goto finish; - if (ret > 0) - continue; - if (u->fd >= 0) { struct pollfd *pollfd; @@ -1031,11 +1009,12 @@ static void thread_func(void *userdata) { } /* Hmm, nothing to do. Let's sleep */ - if (pa_rtpoll_run(u->rtpoll, 1) < 0) { - pa_log("poll() failed: %s", pa_cstrerror(errno)); + if ((ret = pa_rtpoll_run(u->rtpoll, 1)) < 0) goto fail; - } + if (ret == 0) + goto finish; + if (u->fd >= 0) { struct pollfd *pollfd; @@ -1052,8 +1031,8 @@ static void thread_func(void *userdata) { } fail: - /* We have to continue processing messages until we receive the - * SHUTDOWN message */ + /* If this was no regular exit from the loop we have to continue + * processing messages until we received PA_MESSAGE_SHUTDOWN */ pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL); pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN); |