From 45513a2077719850353a9eb34f32ac4548c0dbea Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 1 Sep 2009 22:19:30 +0200 Subject: [PATCH] core: fill up memblock with pa_sink_render_into_full() in pa_sink_render_full() instead of doing our own loop --- src/pulsecore/sink.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index e1ab96d..9388d30 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -1163,21 +1163,15 @@ void pa_sink_render_full(pa_sink *s, size_t length, pa_memchunk *result) { if (result->length < length) { pa_memchunk chunk; - size_t l, d; + pa_memchunk_make_writable(result, length); - l = length - result->length; - d = result->index + result->length; - while (l > 0) { - chunk = *result; - chunk.index = d; - chunk.length = l; + chunk.memblock = result->memblock; + chunk.index = result->index + result->length; + chunk.length = length - result->length; - pa_sink_render_into(s, &chunk); + pa_sink_render_into_full(s, &chunk); - d += chunk.length; - l -= chunk.length; - } result->length = length; } -- 2.7.4