mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
filter-chain: fix volume controls
We need to distribute the volume over the different instances we have of the node, not the MAX amount. See #3434
This commit is contained in:
parent
e71cf62b69
commit
cf44bf73da
1 changed files with 2 additions and 2 deletions
|
|
@ -1133,7 +1133,7 @@ static int sync_volume(struct graph *graph, struct volume *vol)
|
||||||
struct port *p = vol->ports[n_port];
|
struct port *p = vol->ports[n_port];
|
||||||
float v = vol->mute ? 0.0f : vol->volumes[i];
|
float v = vol->mute ? 0.0f : vol->volumes[i];
|
||||||
v = v * (vol->max[n_port] - vol->min[n_port]) + vol->min[n_port];
|
v = v * (vol->max[n_port] - vol->min[n_port]) + vol->min[n_port];
|
||||||
res += port_set_control_value(p, &v, i % MAX_HNDL);
|
res += port_set_control_value(p, &v, i % p->node->n_hndl);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -1986,7 +1986,7 @@ static int parse_volume(struct graph *graph, struct spa_json *json, bool capture
|
||||||
pw_log_error("too many volume controls");
|
pw_log_error("too many volume controls");
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
pw_log_info("volume %d: %s:%s %f %f", vol->n_ports, port->node->name,
|
pw_log_info("volume %d: \"%s:%s\" min:%f max:%f", vol->n_ports, port->node->name,
|
||||||
port->node->desc->desc->ports[port->p].name, min, max);
|
port->node->desc->desc->ports[port->p].name, min, max);
|
||||||
|
|
||||||
vol->ports[vol->n_ports] = port;
|
vol->ports[vol->n_ports] = port;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue