summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/vchan.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pcm/vchan.c')
-rw-r--r--sys/dev/sound/pcm/vchan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
index dc5358d..3866ece 100644
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -332,7 +332,7 @@ sysctl_hw_snd_vchans(SYSCTL_HANDLER_ARGS)
struct snddev_info *d;
struct snddev_channel *sce;
struct pcm_channel *c;
- int err, newcnt, cnt;
+ int err, oldcnt, newcnt, cnt;
d = oidp->oid_arg1;
@@ -343,6 +343,7 @@ sysctl_hw_snd_vchans(SYSCTL_HANDLER_ARGS)
if ((c->direction == PCMDIR_PLAY) && (c->flags & CHN_F_VIRTUAL))
cnt++;
}
+ oldcnt = cnt;
newcnt = cnt;
err = sysctl_handle_int(oidp, &newcnt, sizeof(newcnt), req);
@@ -379,6 +380,8 @@ addok:
if (err == 0)
cnt++;
}
+ if (SLIST_EMPTY(&c->children))
+ c->flags &= ~CHN_F_BUSY;
} else if (newcnt < cnt) {
while (err == 0 && newcnt < cnt) {
SLIST_FOREACH(sce, &d->channels, link) {
OpenPOWER on IntegriCloud