From 3536be420cf9ec6f4f8fbe1dc60b2da0cefba86c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 6 Sep 2004 18:55:47 +0000 Subject: correct a recording bug in native protocol git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@181 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/protocol-native.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'polyp/protocol-native.c') diff --git a/polyp/protocol-native.c b/polyp/protocol-native.c index 67352b3f..1ec1b608 100644 --- a/polyp/protocol-native.c +++ b/polyp/protocol-native.c @@ -378,12 +378,14 @@ static void send_memblock(struct connection *c) { return; if (pa_memblockq_peek(r->memblockq, &chunk) >= 0) { - if (chunk.length > r->fragment_size) - chunk.length = r->fragment_size; + struct pa_memchunk schunk = chunk; + + if (schunk.length > r->fragment_size) + schunk.length = r->fragment_size; - pa_pstream_send_memblock(c->pstream, r->index, 0, &chunk); - pa_memblockq_drop(r->memblockq, &chunk, chunk.length); - pa_memblock_unref(chunk.memblock); + pa_pstream_send_memblock(c->pstream, r->index, 0, &schunk); + pa_memblockq_drop(r->memblockq, &chunk, schunk.length); + pa_memblock_unref(schunk.memblock); return; } -- cgit