diff options
author | cg <cg@FreeBSD.org> | 2001-06-26 21:54:55 +0000 |
---|---|---|
committer | cg <cg@FreeBSD.org> | 2001-06-26 21:54:55 +0000 |
commit | 773e1607789dcccaee7122556d14d6d3698355ca (patch) | |
tree | 531c0ff9e1974120e044731d59a54c9ea255ac2a /sys/dev/sound/pcm/vchan.c | |
parent | aa831c7a7bf3742803e44b67cc2a0fb4aa3e26f8 (diff) | |
download | FreeBSD-src-773e1607789dcccaee7122556d14d6d3698355ca.zip FreeBSD-src-773e1607789dcccaee7122556d14d6d3698355ca.tar.gz |
add a tunable/sysctl, hw.snd.autovchans. if this is set to a value n where
n > 0, n vchans will be assigned to any devices that subsequently register
with a single playback channel.
Diffstat (limited to 'sys/dev/sound/pcm/vchan.c')
-rw-r--r-- | sys/dev/sound/pcm/vchan.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 3866ece..25e48c1 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -348,6 +348,11 @@ sysctl_hw_snd_vchans(SYSCTL_HANDLER_ARGS) err = sysctl_handle_int(oidp, &newcnt, sizeof(newcnt), req); if (err == 0 && req->newptr != NULL) { + if (newcnt < 0 || newcnt > SND_MAXVCHANS) { + snd_mtxunlock(d->lock); + return EINVAL; + } + if (newcnt > cnt) { /* add new vchans - find a parent channel first */ SLIST_FOREACH(sce, &d->channels, link) { |