Merge HUGE set of changes temporarily into a branch, to allow me to move them from one machine to another (lock-free and stuff)

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1469 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-06-11 12:08:37 +00:00
parent 6aeec56708
commit 00da37f2c4
72 changed files with 4389 additions and 1767 deletions

View file

@ -180,6 +180,7 @@ static void do_read(struct userdata *u) {
pa_memchunk post_memchunk;
snd_pcm_sframes_t frames;
size_t l;
void *p;
if (!u->memchunk.memblock) {
u->memchunk.memblock = pa_memblock_new(u->source->core->mempool, u->memchunk.length = u->fragment_size);
@ -188,11 +189,13 @@ static void do_read(struct userdata *u) {
assert(u->memchunk.memblock);
assert(u->memchunk.length);
assert(u->memchunk.memblock->data);
assert(u->memchunk.memblock->length);
assert(u->memchunk.length % u->frame_size == 0);
if ((frames = snd_pcm_readi(u->pcm_handle, (uint8_t*) u->memchunk.memblock->data + u->memchunk.index, u->memchunk.length / u->frame_size)) < 0) {
p = pa_memblock_acquire(u->memchunk.memblock);
if ((frames = snd_pcm_readi(u->pcm_handle, (uint8_t*) p + u->memchunk.index, u->memchunk.length / u->frame_size)) < 0) {
pa_memblock_release(u->memchunk.memblock);
if (frames == -EAGAIN)
return;
@ -216,6 +219,7 @@ static void do_read(struct userdata *u) {
pa_module_unload_request(u->module);
return;
}
pa_memblock_release(u->memchunk.memblock);
l = frames * u->frame_size;