[pulseaudio-discuss] [PATCH] optimization: Optimized pa_sink_render_full.

Jyri Sarha LEPBTETFMVBZ at spammotel.com
Wed May 13 23:42:52 PDT 2009


From: Jyri Sarha <jyri.sarha at nokia.com>

This is finally the latest version of the patch.
---
 src/pulsecore/sink.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 28b3440..bd4130f 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1010,14 +1010,13 @@ void pa_sink_render_full(pa_sink *s, size_t length, pa_memchunk *result) {
 	pa_memchunk chunk;
 	size_t l, d;
 	pa_memchunk_make_writable(result, length);
-	result->length = length;
 
 	l = length - result->length;
 	d = result->index + result->length;
 	while (l > 0) {
 	    chunk = *result;
-	    chunk.index += d;
-	    chunk.length -= d - result->index;
+	    chunk.index = d;
+	    chunk.length = l;
 
 	    pa_sink_render_into(s, &chunk);
 
-- 
1.5.6.3




More information about the pulseaudio-discuss mailing list