mixer

FreeBSD OSS mixer library implementation and a complete rewrite of mixer(8)
git clone git://git.margiolis.net/mixer.git
Log | Files | Refs | README

commit 90e81ce8fce5b824d9330df884e93fbbe736eca0
parent 2a4476d554b6cf244c3c5019968640bea28e94ee
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sun, 11 Jul 2021 17:25:01 +0300

kernel: remove reduntant initializations

Diffstat:
MREADME | 6+++---
Mdiff/mixer_kern.diff | 26+++-----------------------
2 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/README b/README @@ -1,9 +1,9 @@ mixer ===== -An OSS mixer library implementation for FreeBSD, and a complete rewrite -of mixer(8) to use it and its new features. Some of its development is -part of Google Summer of Code 2021. +An OSS mixer library implementation, a complete rewrite of mixer(8) +and sound(4) update for FreeBSD. Some of its development is part of +Google Summer of Code 2021. Usage ----- diff --git a/diff/mixer_kern.diff b/diff/mixer_kern.diff @@ -1,5 +1,5 @@ diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c -index 92c5f3d613e..55f69c4b242 100644 +index 92c5f3d613e..b84396c0b8b 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -58,9 +58,11 @@ struct snd_mixer { @@ -159,27 +159,7 @@ index 92c5f3d613e..55f69c4b242 100644 u_int32_t mix_getrecdevs(struct snd_mixer *m) { -@@ -711,6 +776,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) - if (m == NULL) - return (-1); - -+ m->mutedevs = 0; - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { - v = snd_mixerdefaults[i]; - -@@ -722,6 +788,11 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) - } - - mixer_set(m, i, v | (v << 8)); -+ /* -+ * Make sure we don't use an uninitialized value in -+ * `mixer_setmute`. -+ */ -+ m->level_muted[i] = 0; - } - - mixer_setrecsrc(m, 0); /* Set default input. */ -@@ -1305,10 +1376,16 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, +@@ -1305,10 +1370,16 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, goto done; } if ((cmd & ~0xff) == MIXER_WRITE(0)) { @@ -198,7 +178,7 @@ index 92c5f3d613e..55f69c4b242 100644 snd_mtxunlock(m->lock); return ((ret == 0) ? 0 : ENXIO); } -@@ -1319,6 +1396,9 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, +@@ -1319,6 +1390,9 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case SOUND_MIXER_STEREODEVS: v = mix_getdevs(m); break;