Deleted Added
full compact
31c31
< SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/mixer.c 168264 2007-04-02 10:24:15Z ariff $");
---
> SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/mixer.c 170161 2007-05-31 18:43:33Z ariff $");
102c102
< static eventhandler_tag mixer_ehtag;
---
> static eventhandler_tag mixer_ehtag = NULL;
133,136c133,134
< struct snddev_channel *sce;
< struct pcm_channel *ch;
< #ifdef USING_MUTEX
< int locked = (mixer->lock && mtx_owned((struct mtx *)(mixer->lock))) ? 1 : 0;
---
> struct pcm_channel *c;
> int locked;
137a136,137
> locked = (mixer->lock != NULL &&
> mtx_owned((struct mtx *)(mixer->lock))) ? 1 : 0;
140,147c140,156
< #endif
< SLIST_FOREACH(sce, &d->channels, link) {
< ch = sce->channel;
< CHN_LOCK(ch);
< if (ch->direction == PCMDIR_PLAY &&
< (ch->feederflags & (1 << FEEDER_VOLUME)))
< chn_setvolume(ch, left, right);
< CHN_UNLOCK(ch);
---
>
> if (CHN_EMPTY(d, channels.pcm.busy)) {
> CHN_FOREACH(c, d, channels.pcm) {
> CHN_LOCK(c);
> if (c->direction == PCMDIR_PLAY &&
> (c->feederflags & (1 << FEEDER_VOLUME)))
> chn_setvolume(c, left, right);
> CHN_UNLOCK(c);
> }
> } else {
> CHN_FOREACH(c, d, channels.pcm.busy) {
> CHN_LOCK(c);
> if (c->direction == PCMDIR_PLAY &&
> (c->feederflags & (1 << FEEDER_VOLUME)))
> chn_setvolume(c, left, right);
> CHN_UNLOCK(c);
> }
149c158
< #ifdef USING_MUTEX
---
>
152c161
< #endif
---
>
483c492
< int i, unit, val;
---
> int i, unit, devunit, val;
517c526,527
< pdev = make_dev(&mixer_cdevsw, PCMMKMINOR(unit, SND_DEV_CTL, 0),
---
> devunit = snd_mkunit(unit, SND_DEV_CTL, 0);
> pdev = make_dev(&mixer_cdevsw, unit2minor(devunit),
848,849c858,862
< mixer_clone(void *arg, struct ucred *cred, char *name, int namelen,
< struct cdev **dev)
---
> mixer_clone(void *arg,
> #if __FreeBSD_version >= 600034
> struct ucred *cred,
> #endif
> char *name, int namelen, struct cdev **dev)
851c864
< struct snddev_info *sd;
---
> struct snddev_info *d;
856,858c869,871
< sd = devclass_get_softc(pcm_devclass, snd_unit);
< if (sd != NULL && sd->mixer_dev != NULL) {
< *dev = sd->mixer_dev;
---
> d = devclass_get_softc(pcm_devclass, snd_unit);
> if (d != NULL && d->mixer_dev != NULL) {
> *dev = d->mixer_dev;
866a880,881
> if (mixer_ehtag != NULL)
> return;
873,874c888,891
< if (mixer_ehtag != NULL)
< EVENTHANDLER_DEREGISTER(dev_clone, mixer_ehtag);
---
> if (mixer_ehtag == NULL)
> return;
> EVENTHANDLER_DEREGISTER(dev_clone, mixer_ehtag);
> mixer_ehtag = NULL;