On Wed, 2012-10-17 at 16:20 +0200, Peter Meerwald wrote: > > > > +static void remap_stereo_to_mono_c(pa_remap_t *m, void *dst, const void *src, unsigned n) { > > > + unsigned i; > > > + > > > + switch (*m->format) { > > > + case PA_SAMPLE_FLOAT32NE: > > > + { > > > + float *d = (float *) dst, *s = (float *) src; > > > + > > > + for (i = n >> 2; i > 0; i--) { > > > + d[0] = s[0] + s[1]; > > > + d[1] = s[2] + s[3]; > > > + d[2] = s[4] + s[5]; > > > + d[3] = s[6] + s[7]; > > > + s += 8; > > > + d += 4; > > > + } > > > + for (i = n & 3; i; i--) { > > > Shouldn't this (and the next case) be (n & 2)? > > the first loop processes floor(n/4)*4 elements, the second loop processes > the remaining n % 4 == n & 3 elements D'oh! Sorry, that was a brainfart -- read 3 bits instead of numeric 3. -- Arun