diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-08-19 16:23:55 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-08-20 11:31:04 +0200 |
commit | d04a6e935f8352a4ffd93cb1aeddac8f605a099a (patch) | |
tree | ce10f2e21199cf863a82b715f9a1e45d25a3b7f9 /src/pulsecore/resampler.c | |
parent | b4e9942c2f3929b4baf4b53b0561102af7845269 (diff) |
resample: fix counters
Diffstat (limited to 'src/pulsecore/resampler.c')
-rw-r--r-- | src/pulsecore/resampler.c | 8 |
1 files 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)); } } |