diff options
author | mdodd <mdodd@FreeBSD.org> | 2003-06-26 13:13:18 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2003-06-26 13:13:18 +0000 |
commit | eb5358bc434ed50b7de78727744ec72d27d0d97d (patch) | |
tree | 9fd83a4e4ab9595ce11abeeaf27908eabc5aa7bc /sys/dev/sound | |
parent | a70925a0c156adba6664bb8e3c13d25297f67403 (diff) | |
download | FreeBSD-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/sound')
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 6 |
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; |