summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-06-26 13:13:18 +0000
committermdodd <mdodd@FreeBSD.org>2003-06-26 13:13:18 +0000
commiteb5358bc434ed50b7de78727744ec72d27d0d97d (patch)
tree9fd83a4e4ab9595ce11abeeaf27908eabc5aa7bc /sys/dev
parenta70925a0c156adba6664bb8e3c13d25297f67403 (diff)
downloadFreeBSD-src-eb5358bc434ed50b7de78727744ec72d27d0d97d.zip
FreeBSD-src-eb5358bc434ed50b7de78727744ec72d27d0d97d.tar.gz
Set a lower bound on fragment size rather than returning a failure
when the user specifies a maximum fragment size < 2. This is the behavior that Linux provides and fixes the problem I've observed in Tribes2 where sounds effects are delayed by 1/2 a second.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sound/pcm/dsp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 04622d2..61b3b41 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -774,10 +774,8 @@ dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
if (maxfrags == 0)
maxfrags = CHN_2NDBUFMAXSIZE / fragsz;
- if (maxfrags < 2) {
- ret = EINVAL;
- break;
- }
+ if (maxfrags < 2)
+ maxfrags = 2;
if (maxfrags * fragsz > CHN_2NDBUFMAXSIZE)
maxfrags = CHN_2NDBUFMAXSIZE / fragsz;
OpenPOWER on IntegriCloud