[pulseaudio-discuss] [PATCH 17/23] core: mix: Combine loops over streams in pa_mix()

Peter Meerwald pmeerw at pmeerw.net
Wed Feb 13 08:27:04 PST 2013


Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/pulsecore/mix.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c
index 73a0962..0db5f59 100644
--- a/src/pulsecore/mix.c
+++ b/src/pulsecore/mix.c
@@ -561,7 +561,6 @@ size_t pa_mix(
 
     pa_cvolume full_volume;
     unsigned k;
-    unsigned z;
     void *end;
 
     pa_assert(streams);
@@ -577,12 +576,11 @@ size_t pa_mix(
         return length;
     }
 
-    for (k = 0; k < nstreams; k++)
+    for (k = 0; k < nstreams; k++) {
         streams[k].ptr = pa_memblock_acquire_chunk(&streams[k].chunk);
-
-    for (z = 0; z < nstreams; z++)
-        if (length > streams[z].chunk.length)
-            length = streams[z].chunk.length;
+        if (length > streams[k].chunk.length)
+            length = streams[k].chunk.length;
+    }
 
     end = (uint8_t*) data + length;
 
-- 
1.7.9.5



More information about the pulseaudio-discuss mailing list