summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-11-03 17:13:00 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-11-03 17:13:00 +0000
commit682a395ac5fa789533c214e049dd1233d59c7aae (patch)
tree53d5c01241a127c3cd0711ed2766df1df9d82c34 /usr.bin
parent58a3b20de45d8bc4f89a942a16f8e1e1c5ea450a (diff)
Prefill client rec buffer with silence. This is necessary because
certain channels don't get samples, for instance when mono->stereo conversion is disabled.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sndiod/dev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c
index 8adca3c1c02..642ea6386e6 100644
--- a/usr.bin/sndiod/dev.c
+++ b/usr.bin/sndiod/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.28 2017/02/15 21:28:23 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.29 2017/11/03 17:12:59 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -1709,6 +1709,10 @@ slot_attach(struct slot *s)
enc_init(&s->sub.enc, &s->par, slot_nch);
s->sub.encbuf =
xmalloc(s->round * slot_nch * sizeof(adata_t));
+ enc_sil_do(&s->sub.enc, s->sub.buf.data, s->appbufsz);
+ } else {
+ memset(s->sub.buf.data, 0,
+ s->appbufsz * slot_nch * sizeof(adata_t));
}
/*