diff options
author | 2010-07-19 07:57:36 +0000 | |
---|---|---|
committer | 2010-07-19 07:57:36 +0000 | |
commit | 3285896f246fc3948edd0e2f95a6490279f05f91 (patch) | |
tree | 84b2a70a8b901de0472b35e13b1172384c2fea48 | |
parent | remove Xr to self; from Daniel Dickman (diff) | |
download | wireguard-openbsd-3285896f246fc3948edd0e2f95a6490279f05f91.tar.xz wireguard-openbsd-3285896f246fc3948edd0e2f95a6490279f05f91.zip |
* don't round blocksize to multiples of 16; can cause problems when
sample size or number of channels is not a power of 2.
* use 'param->bps' instead of 'param->precision / NBBY' for the number
of bytes per sample.
ok ratchov
-rw-r--r-- | sys/dev/usb/uaudio.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 120f0382430..8aadc1b1c88 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.76 2010/07/19 05:50:37 jakemsr Exp $ */ +/* $OpenBSD: uaudio.c,v 1.77 2010/07/19 07:57:36 jakemsr Exp $ */ /* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */ /* @@ -2241,8 +2241,6 @@ uaudio_round_blocksize(void *addr, int blk) } bpf = max(pbpf, rbpf); - bpf = (bpf + 15) &~ 15; - if (blk < bpf) blk = bpf; @@ -2981,8 +2979,7 @@ uaudio_chan_init(struct chan *ch, int altidx, const struct audio_params *param, ch->altidx = altidx; ch->maxpktsize = maxpktsize; ch->sample_rate = param->sample_rate; - ch->sample_size = param->factor * param->channels * - param->precision / NBBY; + ch->sample_size = param->factor * param->channels * param->bps; ch->usb_fps = USB_FRAMES_PER_SECOND; /* |