From eb5358bc434ed50b7de78727744ec72d27d0d97d Mon Sep 17 00:00:00 2001 From: mdodd Date: Thu, 26 Jun 2003 13:13:18 +0000 Subject: [PATCH] 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. --- sys/dev/sound/pcm/dsp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 04622d29c365..61b3b418410a 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;