summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2017-03-28 05:23:15 +0000
committerratchov <ratchov@openbsd.org>2017-03-28 05:23:15 +0000
commit94c25ab859f53d6c33c591e54a26dc5606424eaa (patch)
treeee097b5fd3c61e2ff0dedc200d32e33c32c22f38
parentSimplify rate/channels/bits bounds checking code. From (diff)
downloadwireguard-openbsd-94c25ab859f53d6c33c591e54a26dc5606424eaa.tar.xz
wireguard-openbsd-94c25ab859f53d6c33c591e54a26dc5606424eaa.zip
Make set_params() return the rate the device is using. Fixes
a wrong rate being reported when a unsupported rate was requested.
-rw-r--r--sys/dev/pci/envy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c
index 2f7aaea9684..c620a27335c 100644
--- a/sys/dev/pci/envy.c
+++ b/sys/dev/pci/envy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: envy.c,v 1.69 2017/02/10 08:05:14 ratchov Exp $ */
+/* $OpenBSD: envy.c,v 1.70 2017/03/28 05:23:15 ratchov Exp $ */
/*
* Copyright (c) 2007 Alexandre Ratchov <alex@caoua.org>
*
@@ -1852,6 +1852,7 @@ envy_set_params(void *self, int setmode, int usemode,
reg |= envy_rates[i].reg;
envy_mt_write_1(sc, ENVY_MT_RATE, reg);
if (setmode & AUMODE_PLAY) {
+ p->sample_rate = envy_rates[i].rate;
p->encoding = AUDIO_ENCODING_SLINEAR_LE;
p->precision = 24;
p->bps = 4;
@@ -1859,6 +1860,7 @@ envy_set_params(void *self, int setmode, int usemode,
p->channels = sc->isht ? sc->card->noch : ENVY_PCHANS;
}
if (setmode & AUMODE_RECORD) {
+ r->sample_rate = envy_rates[i].rate;
r->encoding = AUDIO_ENCODING_SLINEAR_LE;
r->precision = 24;
r->bps = 4;