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 @@ -2107,21 +2107,20 @@ int chn_setspeed(struct pcm_channel *c, uint32_t speed) { - uint32_t oldformat, oldspeed, format; + uint32_t oldformat, oldspeed; int ret; oldformat = c->format; oldspeed = c->speed; - format = oldformat; - ret = chn_setparam(c, format, speed); + ret = chn_setparam(c, c->format, speed); if (ret != 0) { if (snd_verbose > 3) device_printf(c->dev, "%s(): Setting speed %d failed, " "falling back to %d\n", __func__, speed, oldspeed); - chn_setparam(c, c->format, oldspeed); + chn_setparam(c, oldformat, oldspeed); } return (ret); @@ -2130,7 +2129,7 @@ int chn_setformat(struct pcm_channel *c, uint32_t format) { - uint32_t oldformat, oldspeed, speed; + uint32_t oldformat, oldspeed; int ret; /* XXX force stereo */ @@ -2141,9 +2140,8 @@ oldformat = c->format; oldspeed = c->speed; - speed = oldspeed; - ret = chn_setparam(c, format, speed); + ret = chn_setparam(c, format, c->speed); if (ret != 0) { if (snd_verbose > 3) device_printf(c->dev,