control: keep track of prop_id

Keep track of the property id which describes the property
functionality.
Link controls based on the property instead of the param_id.
This commit is contained in:
Wim Taymans 2018-02-07 17:56:35 +01:00
parent 053f251be8
commit 2fe6a8245d
3 changed files with 19 additions and 9 deletions

View file

@ -148,15 +148,24 @@ static void try_link_controls(struct impl *impl, struct pw_port *port, struct pw
struct pw_control *cin, *cout;
int res;
pw_log_debug("module %p: trying controls", impl);
spa_list_for_each(cout, &port->control_list[SPA_DIRECTION_OUTPUT], port_link) {
spa_list_for_each(cin, &target->control_list[SPA_DIRECTION_INPUT], port_link) {
pw_log_debug("controls %d <-> %d", cin->id, cout->id);
if (cin->id == cout->id) {
if (cin->prop_id == cout->prop_id) {
if ((res = pw_control_link(cout, cin)) < 0)
pw_log_error("failed to link controls: %s", spa_strerror(res));
}
}
}
spa_list_for_each(cin, &port->control_list[SPA_DIRECTION_INPUT], port_link) {
spa_list_for_each(cout, &target->control_list[SPA_DIRECTION_OUTPUT], port_link) {
if (cin->prop_id == cout->prop_id) {
if ((res = pw_control_link(cout, cin)) < 0)
pw_log_error("failed to link controls: %s", spa_strerror(res));
}
}
}
}