From 45700da4ebf2986126d7a4d6889c028599fd3085 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 17 Feb 2006 15:42:47 +0000 Subject: 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 --- src/polyp/context.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/polyp/context.c') diff --git a/src/polyp/context.c b/src/polyp/context.c index b7f7eb99..c40041c5 100644 --- a/src/polyp/context.c +++ b/src/polyp/context.c @@ -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); } -- cgit