[pulseaudio-commits] r1487 - /branches/lennart/src/modules/module-pipe-source.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sat Jun 23 13:02:30 PDT 2007
Author: lennart
Date: Sat Jun 23 22:02:28 2007
New Revision: 1487
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1487&root=3Dpulseaudio&vi=
ew=3Drev
Log:
fix a typo and some minor optimizations
Modified:
branches/lennart/src/modules/module-pipe-source.c
Modified: branches/lennart/src/modules/module-pipe-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-pipe-source.c?rev=3D1487&root=3Dpulseaudio&r1=3D1486&r2=3D1487&view=3D=
diff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-pipe-source.c (original)
+++ branches/lennart/src/modules/module-pipe-source.c Sat Jun 23 22:02:28 2=
007
@@ -99,8 +99,6 @@
=
pa_log_debug("Thread starting up");
=
- pa_memchunk_reset(&u->memchunk);
- =
memset(&pollfd, 0, sizeof(pollfd));
=
pollfd[POLLFD_ASYNCQ].fd =3D pa_asyncmsgq_get_fd(u->asyncmsgq);
@@ -128,19 +126,19 @@
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 =3D=3D PA_SOURCE_RUNNING && pollf=
d[POLLFD_FIFO].revents) {
void *p;
ssize_t l;
- =
+
if (!u->memchunk.memblock) {
u->memchunk.memblock =3D pa_memblock_new(u->core->mempool,=
PIPE_BUF);
u->memchunk.index =3D u->memchunk.length =3D 0;
}
=
pa_assert(pa_memblock_get_length(u->memchunk.memblock) > u->me=
mchunk.index);
- =
+
p =3D pa_memblock_acquire(u->memchunk.memblock);
l =3D pa_read(u->fd, (uint8_t*) p + u->memchunk.index, pa_memb=
lock_get_length(u->memchunk.memblock) - u->memchunk.index, &read_type);
pa_memblock_release(u->memchunk.memblock);
@@ -157,7 +155,7 @@
}
=
} else {
- =
+
u->memchunk.length =3D l;
pa_source_post(u->source, &u->memchunk);
u->memchunk.index +=3D l;
@@ -172,7 +170,7 @@
}
}
=
- pollfd[POLLFD_FIFO].events =3D u->source->thread_info.state =3D=3D=
PA_SINK_RUNNING ? POLLIN : 0;
+ pollfd[POLLFD_FIFO].events =3D u->source->thread_info.state =3D=3D=
PA_SOURCE_RUNNING ? POLLIN : 0;
=
/* Hmm, nothing to do. Let's sleep */
=
@@ -237,7 +235,8 @@
u->core =3D c;
u->module =3D m;
m->userdata =3D u;
-
+ pa_memchunk_reset(&u->memchunk);
+ =
pa_assert_se(u->asyncmsgq =3D pa_asyncmsgq_new(0));
=
u->filename =3D pa_xstrdup(pa_modargs_get_value(ma, "file", DEFAULT_FI=
LE_NAME));
More information about the pulseaudio-commits
mailing list