summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-01 22:19:30 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-01 22:19:30 +0200
commit45513a2077719850353a9eb34f32ac4548c0dbea (patch)
tree51847cc914ae0c87b0bb0c477240faff34d66d5c /src/pulsecore/sink.c
parent17f609ac830a4a6be9658c7220292a038b2c59ac (diff)
core: fill up memblock with pa_sink_render_into_full() in pa_sink_render_full() instead of doing our own loop
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index e1ab96db..9388d309 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;
}