From a83a600fa0a5861bbde8b6545d65d13a82443d20 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 8 Feb 2014 15:17:38 +0000 Subject: copy the correct number of channels in join/expand --- usr.bin/sndiod/dev.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'usr.bin/sndiod/dev.c') diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c index 6da914b1dca..7e48fcee3fb 100644 --- a/usr.bin/sndiod/dev.c +++ b/usr.bin/sndiod/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.9 2013/12/31 12:27:49 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.10 2014/02/08 15:17:37 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -603,22 +603,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; @@ -821,7 +817,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); -- cgit v1.2.3