summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod/dev.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2014-02-08 15:17:38 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2014-02-08 15:17:38 +0000
commita83a600fa0a5861bbde8b6545d65d13a82443d20 (patch)
tree8d156a26853bf98b0340e481be27856388423953 /usr.bin/sndiod/dev.c
parentf84b2796417534ff00b719f7f7c97ce81cece49e (diff)
copy the correct number of channels in join/expand
Diffstat (limited to 'usr.bin/sndiod/dev.c')
-rw-r--r--usr.bin/sndiod/dev.c10
1 files changed, 3 insertions, 7 deletions
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 <alex@caoua.org>
*
@@ -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);