FreeBSD Bugzilla – Attachment 15096 Details for
Bug 28084
Two possible PCM problems and patch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.15 KB, created by
ak03
on 2001-06-11 23:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
ak03
Created:
2001-06-11 23:40:01 UTC
Size:
2.15 KB
patch
obsolete
>Index: pcm/sound.c >=================================================================== >RCS file: /usr/ncvs/src/sys/dev/sound/pcm/sound.c,v >retrieving revision 1.48 >diff -u -r1.48 sound.c >--- pcm/sound.c 2001/06/10 15:48:03 1.48 >+++ pcm/sound.c 2001/06/11 20:09:47 >@@ -345,10 +345,8 @@ > int unit = device_get_unit(d->dev); > > sce = malloc(sizeof(*sce), M_DEVBUF, M_WAITOK | M_ZERO); >- if (!sce) { >- free(ch, M_DEVBUF); >+ if (!sce) > return ENOMEM; >- } > > snd_mtxlock(d->lock); > sce->channel = ch; >Index: pcm/vchan.c >=================================================================== >RCS file: /usr/ncvs/src/sys/dev/sound/pcm/vchan.c,v >retrieving revision 1.2 >diff -u -r1.2 vchan.c >--- pcm/vchan.c 2001/06/07 20:06:22 1.2 >+++ pcm/vchan.c 2001/06/11 22:07:31 >@@ -331,8 +331,8 @@ > { > struct snddev_info *d; > struct snddev_channel *sce; >- struct pcm_channel *c; >- int err, newcnt, cnt; >+ struct pcm_channel *c, **arec, **aplay; >+ int err, newcnt, cnt, sz; > > d = oidp->oid_arg1; > >@@ -373,12 +373,36 @@ > snd_mtxunlock(d->lock); > return EBUSY; > addok: >+ if (d->maxchans < (d->chancount + newcnt - cnt)) { >+ sz = (d->chancount + newcnt - cnt) * >+ sizeof(struct pcm_channel *); >+ aplay = (struct pcm_channel **) >+ malloc(sz, M_DEVBUF, M_WAITOK | M_ZERO); >+ arec = (struct pcm_channel **) >+ malloc(sz, M_DEVBUF, M_WAITOK | M_ZERO); >+ if (!arec || !aplay) { >+ if (aplay) free(aplay, M_DEVBUF); >+ if (arec) free(arec, M_DEVBUF); >+ return ENOMEM; >+ } >+ sz = d->maxchans * sizeof(struct pcm_channel *); >+ bcopy(d->arec, arec, sz); >+ bcopy(d->aplay, aplay, sz); >+ free(d->arec, M_DEVBUF); >+ free(d->aplay, M_DEVBUF); >+ d->arec = arec; >+ d->aplay = aplay; >+ d->maxchans = d->chancount + newcnt - cnt; >+ } > c->flags |= CHN_F_BUSY; > while (err == 0 && newcnt > cnt) { > err = vchan_create(c); > if (err == 0) > cnt++; > } >+ /* Clear parent busy flag if no children were created */ >+ 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) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 28084
: 15096