diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-11-06 13:06:01 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-11-06 13:06:01 +0000 |
commit | 8dc62142765249addf131b058c27f931ede1776b (patch) | |
tree | 3e9f8b96248e98c83462a45e983e0b298b38ca79 /src/modules/module-alsa-sink.c | |
parent | 6ca819354cabdaeda0b122535a50fa49924d8d2d (diff) | |
download | pulseaudio-8dc62142765249addf131b058c27f931ede1776b.tar.gz |
Revert r1404 and keep it on a development branch until it is fully tested.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1409 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-alsa-sink.c')
-rw-r--r-- | src/modules/module-alsa-sink.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c index 7bbd7de2f..6ff9a6e49 100644 --- a/src/modules/module-alsa-sink.c +++ b/src/modules/module-alsa-sink.c @@ -144,7 +144,6 @@ static void do_write(struct userdata *u) { update_usage(u); for (;;) { - void *p; pa_memchunk *memchunk = NULL; snd_pcm_sframes_t frames; @@ -157,15 +156,9 @@ static void do_write(struct userdata *u) { memchunk = &u->memchunk; } - assert(memchunk->memblock); - assert(memchunk->length); - assert((memchunk->length % u->frame_size) == 0); + assert(memchunk->memblock && memchunk->memblock->data && memchunk->length && memchunk->memblock->length && (memchunk->length % u->frame_size) == 0); - p = pa_memblock_acquire(memchunk->memblock); - - if ((frames = snd_pcm_writei(u->pcm_handle, (uint8_t*) p + memchunk->index, memchunk->length / u->frame_size)) < 0) { - pa_memblock_release(memchunk->memblock); - + if ((frames = snd_pcm_writei(u->pcm_handle, (uint8_t*) memchunk->memblock->data + memchunk->index, memchunk->length / u->frame_size)) < 0) { if (frames == -EAGAIN) return; @@ -183,9 +176,6 @@ static void do_write(struct userdata *u) { return; } - pa_memblock_release(memchunk->memblock); - - if (memchunk == &u->memchunk) { size_t l = frames * u->frame_size; memchunk->index += l; |