mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
filter-chain: don't use id in PropInfo for params
One should use the name of the property in params to access the property.
This commit is contained in:
parent
e31f9aa0f2
commit
fe547251da
|
@ -416,7 +416,6 @@ static struct spa_pod *get_prop_info(struct graph *graph, struct spa_pod_builder
|
||||||
spa_pod_builder_push_object(b, &f[0],
|
spa_pod_builder_push_object(b, &f[0],
|
||||||
SPA_TYPE_OBJECT_PropInfo, SPA_PARAM_PropInfo);
|
SPA_TYPE_OBJECT_PropInfo, SPA_PARAM_PropInfo);
|
||||||
spa_pod_builder_add (b,
|
spa_pod_builder_add (b,
|
||||||
SPA_PROP_INFO_id, SPA_POD_Id(SPA_PROP_START_CUSTOM + idx),
|
|
||||||
SPA_PROP_INFO_name, SPA_POD_String(name),
|
SPA_PROP_INFO_name, SPA_POD_String(name),
|
||||||
0);
|
0);
|
||||||
spa_pod_builder_prop(b, SPA_PROP_INFO_type, 0);
|
spa_pod_builder_prop(b, SPA_PROP_INFO_type, 0);
|
||||||
|
@ -531,30 +530,8 @@ static void param_props_changed(struct impl *impl, const struct spa_pod *param)
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
|
|
||||||
SPA_POD_OBJECT_FOREACH(obj, prop) {
|
SPA_POD_OBJECT_FOREACH(obj, prop) {
|
||||||
uint32_t idx;
|
if (prop->key == SPA_PROP_params)
|
||||||
float value;
|
|
||||||
struct port *port;
|
|
||||||
|
|
||||||
if (prop->key == SPA_PROP_params) {
|
|
||||||
changed += parse_params(graph, &prop->value);
|
changed += parse_params(graph, &prop->value);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (prop->key < SPA_PROP_START_CUSTOM)
|
|
||||||
continue;
|
|
||||||
idx = prop->key - SPA_PROP_START_CUSTOM;
|
|
||||||
if (idx >= graph->n_control)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (spa_pod_get_float(&prop->value, &value) < 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
port = graph->control_port[idx];
|
|
||||||
|
|
||||||
if (port->control_data != value) {
|
|
||||||
port->control_data = value;
|
|
||||||
changed++;
|
|
||||||
pw_log_info("control %d to %f", idx, port->control_data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (changed > 0) {
|
if (changed > 0) {
|
||||||
uint8_t buffer[1024];
|
uint8_t buffer[1024];
|
||||||
|
|
Loading…
Reference in a new issue