Page MenuHomeFreeBSD

D48435.id149650.diff
No OneTemporary

D48435.id149650.diff

diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -497,9 +497,7 @@
KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d",
__func__, direction, c->direction));
- CHN_LOCK(c);
- newspd = c->speed;
- CHN_UNLOCK(c);
+ newspd = *vchanrate;
ret = sysctl_handle_int(oidp, &newspd, 0, req);
if (ret != 0 || req->newptr == NULL) {
@@ -514,6 +512,14 @@
CHN_LOCK(c);
+ if (feeder_rate_round) {
+ caps = chn_getcaps(c);
+ RANGE(newspd, caps->minspeed, caps->maxspeed);
+ newspd = CHANNEL_SETSPEED(c->methods,
+ c->devinfo, newspd);
+ }
+ *vchanrate = newspd;
+
if (newspd != c->speed && VCHAN_ACCESSIBLE(c)) {
if (CHN_STARTED(c)) {
chn_abort(c);
@@ -521,16 +527,8 @@
} else
restart = 0;
- if (feeder_rate_round) {
- caps = chn_getcaps(c);
- RANGE(newspd, caps->minspeed, caps->maxspeed);
- newspd = CHANNEL_SETSPEED(c->methods,
- c->devinfo, newspd);
- }
-
ret = chn_reset(c, c->format, newspd);
if (ret == 0) {
- *vchanrate = c->speed;
if (restart != 0) {
CHN_FOREACH(ch, c, children.busy) {
CHN_LOCK(ch);
@@ -605,15 +603,11 @@
KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d",
__func__, direction, c->direction));
- CHN_LOCK(c);
-
bzero(fmtstr, sizeof(fmtstr));
- if (snd_afmt2str(c->format, fmtstr, sizeof(fmtstr)) != c->format)
+ if (snd_afmt2str(*vchanformat, fmtstr, sizeof(fmtstr)) != *vchanformat)
strlcpy(fmtstr, "<ERROR>", sizeof(fmtstr));
- CHN_UNLOCK(c);
-
ret = sysctl_handle_string(oidp, fmtstr, sizeof(fmtstr), req);
if (ret != 0 || req->newptr == NULL) {
PCM_RELEASE_QUICK(d);
@@ -626,6 +620,8 @@
return (EINVAL);
}
+ *vchanformat = newfmt;
+
CHN_LOCK(c);
if (newfmt != c->format && VCHAN_ACCESSIBLE(c)) {
@@ -637,7 +633,6 @@
ret = chn_reset(c, newfmt, c->speed);
if (ret == 0) {
- *vchanformat = c->format;
if (restart != 0) {
CHN_FOREACH(ch, c, children.busy) {
CHN_LOCK(ch);

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 6:05 AM (41 m, 35 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33296163
Default Alt Text
D48435.id149650.diff (2 KB)

Event Timeline