From 236d573f9300ef74b5167a50bc895ce74c1e5e53 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 8 Feb 2014 16:00:54 +0100 Subject: [PATCH] copy the right number of channels during join/expand --- sndiod/dev.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sndiod/dev.c b/sndiod/dev.c index 632ce9d..0590efb 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -604,22 +604,18 @@ play_filt_resamp(struct slot *s, void *res_in, void *out, int todo) } else in = res_in; - nch = s->mix.slot_cmax - s->mix.slot_cmin + 1; + nch = s->mix.cmap.nch; vol = ADATA_MUL(s->mix.weight, s->mix.vol) / s->mix.join; cmap_add(&s->mix.cmap, in, out, vol, todo); offs = 0; for (i = s->mix.join - 1; i > 0; i--) { offs += nch; - if (offs > s->mix.cmap.inext) - break; cmap_add(&s->mix.cmap, (adata_t *)in + offs, out, vol, todo); } offs = 0; for (i = s->mix.expand - 1; i > 0; i--) { offs += nch; - if (offs > s->mix.cmap.onext) - break; cmap_add(&s->mix.cmap, in, (adata_t *)out + offs, vol, todo); } return todo; @@ -822,7 +818,7 @@ rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo) out = (s->sub.resampbuf) ? s->sub.resampbuf : res_out; - nch = s->sub.slot_cmax - s->sub.slot_cmin + 1; + nch = s->sub.cmap.nch; vol = ADATA_UNIT / s->sub.join; cmap_copy(&s->sub.cmap, in, out, vol, todo);