diff options
author | kan <kan@FreeBSD.org> | 2002-07-23 14:50:51 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2002-07-23 14:50:51 +0000 |
commit | b5e00f20d6496a7b79d129b9425f21dfc13ddfa2 (patch) | |
tree | 68d00e10cab90e1f8a2efd5136fcea403dfacff6 /sys | |
parent | 558b722f1ea49c9329d7011f1f748c44de6a46d9 (diff) | |
download | FreeBSD-src-b5e00f20d6496a7b79d129b9425f21dfc13ddfa2.zip FreeBSD-src-b5e00f20d6496a7b79d129b9425f21dfc13ddfa2.tar.gz |
Fix the sound driver vchan support to work when hw.snd.maxautovchans
has been specified through /boot/loader.conf as opposed to setting it
in /etc/sysctl.conf. Only PCMDIR_PLAY channel can be used as a parent
of virtual channel. Do not initialize a new vchan for a given physical
channel if other physical channel already has one created.
PR: 31597
Approved by: obrien (mentor)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pcm/sound.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index ddf466b..3f346f3 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -504,7 +504,8 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) return err; } - if (snd_maxautovchans > 0 && (d->flags & SD_F_AUTOVCHAN)) { + if (snd_maxautovchans > 0 && (d->flags & SD_F_AUTOVCHAN) && + ch->direction == PCMDIR_PLAY && d->vchancount == 0) { ch->flags |= CHN_F_BUSY; err = vchan_create(ch); if (err) { |