Have a memblock queue on the client side during recording. This makes the

record callback optional in stead of mandatory.

For applications that wish to retain the old behaviour, simply call
pa_stream_peek() followed by pa_stream_drop() in the callback.


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@507 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-02-17 15:42:47 +00:00
parent 6f9a367abc
commit 45700da4eb
6 changed files with 98 additions and 11 deletions

View file

@ -273,11 +273,11 @@ static void pstream_memblock_callback(pa_pstream *p, uint32_t channel, PA_GCC_UN
if (pa_mcalign_pop(s->mcalign, &t) < 0)
break;
if (s->read_callback) {
s->read_callback(s, (uint8_t*) t.memblock->data + t.index, t.length, s->read_userdata);
s->counter += chunk->length;
}
assert(s->record_memblockq);
pa_memblockq_push(s->record_memblockq, &t, t.length);
if (s->read_callback)
s->read_callback(s, pa_stream_readable_size(s), s->read_userdata);
pa_memblock_unref(t.memblock);
}