core: fill up memblock with pa_sink_render_into_full() in pa_sink_render_full() inste...
authorLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2009 20:19:30 +0000 (22:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2009 20:19:30 +0000 (22:19 +0200)
src/pulsecore/sink.c

index e1ab96d..9388d30 100644 (file)
@@ -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;
     }