Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112525244
D48966.id150982.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48966.id150982.diff
View Options
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1186,13 +1186,21 @@
switch (dir) {
case PCMDIR_PLAY:
+ d->playcount++;
+ /* FALLTHROUGH */
case PCMDIR_PLAY_VIRTUAL:
+ if (dir == PCMDIR_PLAY_VIRTUAL)
+ d->pvchancount++;
direction = PCMDIR_PLAY;
vchanrate = &d->pvchanrate;
vchanformat = &d->pvchanformat;
break;
case PCMDIR_REC:
+ d->reccount++;
+ /* FALLTHROUGH */
case PCMDIR_REC_VIRTUAL:
+ if (dir == PCMDIR_REC_VIRTUAL)
+ d->rvchancount++;
direction = PCMDIR_REC;
vchanrate = &d->rvchanrate;
vchanformat = &d->rvchanformat;
@@ -1307,40 +1315,10 @@
*vchanformat = sndbuf_getfmt(c->bufsoft);
}
- switch (c->type) {
- case PCMDIR_PLAY:
- d->playcount++;
- break;
- case PCMDIR_PLAY_VIRTUAL:
- d->pvchancount++;
- break;
- case PCMDIR_REC:
- d->reccount++;
- break;
- case PCMDIR_REC_VIRTUAL:
- d->rvchancount++;
- break;
- default:
- __assert_unreachable();
- }
-
return (c);
fail:
- free_unr(chn_getunr(d, c->type), c->unit);
- feeder_remove(c);
- if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo))
- sndbuf_free(b);
- if (bs)
- sndbuf_destroy(bs);
- if (b)
- sndbuf_destroy(b);
- CHN_LOCK(c);
- chn_lockdestroy(c);
-
- kobj_delete(c->methods, M_DEVBUF);
- free(c, M_DEVBUF);
-
+ chn_kill(c);
PCM_LOCK(d);
return (NULL);
@@ -1383,12 +1361,14 @@
chn_trigger(c, PCMTRIG_ABORT);
CHN_UNLOCK(c);
}
- free_unr(chn_getunr(c->parentsnddev, c->type), c->unit);
+ free_unr(chn_getunr(d, c->type), c->unit);
feeder_remove(c);
- if (CHANNEL_FREE(c->methods, c->devinfo))
+ if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo))
sndbuf_free(b);
- sndbuf_destroy(bs);
- sndbuf_destroy(b);
+ if (bs)
+ sndbuf_destroy(bs);
+ if (b)
+ sndbuf_destroy(b);
CHN_LOCK(c);
c->flags |= CHN_F_DEAD;
chn_lockdestroy(c);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 8:17 AM (16 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16645327
Default Alt Text
D48966.id150982.diff (1 KB)
Attached To
Mode
D48966: sound: Call chn_kill() in chn_init() failure
Attached
Detach File
Event Timeline
Log In to Comment