mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
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:
parent
6aeec56708
commit
00da37f2c4
72 changed files with 4389 additions and 1767 deletions
|
|
@ -174,6 +174,7 @@ static void do_write(struct userdata *u) {
|
|||
update_usage(u);
|
||||
|
||||
for (;;) {
|
||||
void *p;
|
||||
pa_memchunk *memchunk = NULL;
|
||||
snd_pcm_sframes_t frames;
|
||||
|
||||
|
|
@ -185,14 +186,15 @@ static void do_write(struct userdata *u) {
|
|||
else
|
||||
memchunk = &u->memchunk;
|
||||
}
|
||||
|
||||
assert(memchunk->memblock);
|
||||
assert(memchunk->memblock->data);
|
||||
assert(memchunk->length);
|
||||
assert(memchunk->memblock->length);
|
||||
assert((memchunk->length % u->frame_size) == 0);
|
||||
|
||||
if ((frames = snd_pcm_writei(u->pcm_handle, (uint8_t*) memchunk->memblock->data + memchunk->index, 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 == -EAGAIN)
|
||||
return;
|
||||
|
||||
|
|
@ -217,6 +219,8 @@ 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue