mix: Combine loops over streams in pa_mix()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2013-02-13 17:27:04 +01:00 committed by Tanu Kaskinen
parent 9fa000bbfc
commit b123cfa7c9

View file

@ -561,7 +561,6 @@ size_t pa_mix(
pa_cvolume full_volume; pa_cvolume full_volume;
unsigned k; unsigned k;
unsigned z;
void *end; void *end;
pa_assert(streams); pa_assert(streams);
@ -577,12 +576,11 @@ size_t pa_mix(
return length; return length;
} }
for (k = 0; k < nstreams; k++) for (k = 0; k < nstreams; k++) {
streams[k].ptr = pa_memblock_acquire_chunk(&streams[k].chunk); streams[k].ptr = pa_memblock_acquire_chunk(&streams[k].chunk);
if (length > streams[k].chunk.length)
for (z = 0; z < nstreams; z++) length = streams[k].chunk.length;
if (length > streams[z].chunk.length) }
length = streams[z].chunk.length;
end = (uint8_t*) data + length; end = (uint8_t*) data + length;