summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/sound/pcm/channel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 98208ca..4e37da4 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1124,7 +1124,7 @@ fmtvalid(u_int32_t fmt, u_int32_t *fmtlist)
int
chn_reset(pcm_channel *c, u_int32_t fmt)
{
- int r = 0;
+ int hwspd, r = 0;
chn_abort(c);
c->flags &= CHN_F_RESET;
@@ -1134,10 +1134,13 @@ chn_reset(pcm_channel *c, u_int32_t fmt)
if (r)
return r;
if (fmt) {
- c->speed = DSP_DEFAULT_SPEED;
+ hwspd = DSP_DEFAULT_SPEED;
+ RANGE(hwspd, chn_getcaps(c)->minspeed, chn_getcaps(c)->maxspeed);
+ c->speed = hwspd;
+
r = chn_setformat(c, fmt);
if (r == 0)
- r = chn_setspeed(c, DSP_DEFAULT_SPEED);
+ r = chn_setspeed(c, hwspd);
if (r == 0)
r = chn_setvolume(c, 100, 100);
}
OpenPOWER on IntegriCloud