From d04a6e935f8352a4ffd93cb1aeddac8f605a099a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 19 Aug 2009 16:23:55 +0200 Subject: resample: fix counters --- src/pulsecore/resampler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c index 4fb03ce7..cc57b54e 100644 --- a/src/pulsecore/resampler.c +++ b/src/pulsecore/resampler.c @@ -1099,7 +1099,7 @@ static void remap_mono_to_stereo(pa_resampler *r, void *dst, const void *src, un } static void remap_channels_matrix (pa_resampler *r, void *dst, const void *src, unsigned n) { - unsigned oc; + unsigned oc, i; unsigned n_ic, n_oc; n_ic = r->i_ss.channels; @@ -1126,7 +1126,7 @@ static void remap_channels_matrix (pa_resampler *r, void *dst, const void *src, d = (float *)dst + oc; s = (float *)src + ic; - for (; n > 0; n--, s += n_ic, d += n_oc) + for (i = n; i > 0; i--, s += n_ic, d += n_oc) *d += *s * vol; } } @@ -1152,10 +1152,10 @@ static void remap_channels_matrix (pa_resampler *r, void *dst, const void *src, s = (int16_t *)src + ic; if (vol >= 0x10000) { - for (; n > 0; n--, s += n_ic, d += n_oc) + for (i = n; i > 0; i--, s += n_ic, d += n_oc) *d += *s; } else { - for (; n > 0; n--, s += n_ic, d += n_oc) + for (i = n; i > 0; i--, s += n_ic, d += n_oc) *d = (int16_t) (*d + (((int32_t)*s * vol) >> 16)); } } -- cgit