fix a typo and some minor optimizations

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1487 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-06-23 20:02:28 +00:00
parent 1c9bd201ec
commit fff9081c4b

View file

@ -99,8 +99,6 @@ static void thread_func(void *userdata) {
pa_log_debug("Thread starting up"); pa_log_debug("Thread starting up");
pa_memchunk_reset(&u->memchunk);
memset(&pollfd, 0, sizeof(pollfd)); memset(&pollfd, 0, sizeof(pollfd));
pollfd[POLLFD_ASYNCQ].fd = pa_asyncmsgq_get_fd(u->asyncmsgq); pollfd[POLLFD_ASYNCQ].fd = pa_asyncmsgq_get_fd(u->asyncmsgq);
@ -128,7 +126,7 @@ static void thread_func(void *userdata) {
continue; continue;
} }
/* Render some data and write it to the fifo */ /* Try to read some data and pass it on to the source driver */
if (u->source->thread_info.state == PA_SOURCE_RUNNING && pollfd[POLLFD_FIFO].revents) { if (u->source->thread_info.state == PA_SOURCE_RUNNING && pollfd[POLLFD_FIFO].revents) {
void *p; void *p;
@ -172,7 +170,7 @@ static void thread_func(void *userdata) {
} }
} }
pollfd[POLLFD_FIFO].events = u->source->thread_info.state == PA_SINK_RUNNING ? POLLIN : 0; pollfd[POLLFD_FIFO].events = u->source->thread_info.state == PA_SOURCE_RUNNING ? POLLIN : 0;
/* Hmm, nothing to do. Let's sleep */ /* Hmm, nothing to do. Let's sleep */
@ -237,6 +235,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->core = c; u->core = c;
u->module = m; u->module = m;
m->userdata = u; m->userdata = u;
pa_memchunk_reset(&u->memchunk);
pa_assert_se(u->asyncmsgq = pa_asyncmsgq_new(0)); pa_assert_se(u->asyncmsgq = pa_asyncmsgq_new(0));