pipewire: impl-{node,port}: do not cache failed param enumerations

If the param enumeration fails, do not set `spa_param_info::user` to 1
indicating that the result is cached. Doing so can lead to the first
(uncached) call failing, while the rest will succeed (with 0 params).
This commit is contained in:
Barnabás Pőcze 2026-03-09 20:50:53 +01:00 committed by Wim Taymans
parent 22a5fad902
commit 5e37d43881
2 changed files with 14 additions and 4 deletions

View file

@ -2653,8 +2653,13 @@ int pw_impl_node_for_each_param(struct pw_impl_node *node,
spa_hook_remove(&listener);
if (user_data.cache) {
pw_param_update(&impl->param_list, &impl->pending_list, 0, NULL);
pi->user = 1;
if (SPA_RESULT_IS_OK(res) && !SPA_RESULT_IS_ASYNC(res)) {
pw_param_update(&impl->param_list, &impl->pending_list, 0, NULL);
pi->user = 1;
}
else {
pw_param_clear(&impl->pending_list, SPA_ID_INVALID);
}
}
}
return res;

View file

@ -1740,8 +1740,13 @@ int pw_impl_port_for_each_param(struct pw_impl_port *port,
spa_hook_remove(&listener);
if (user_data.cache) {
pw_param_update(&impl->param_list, &impl->pending_list, 0, NULL);
pi->user = 1;
if (SPA_RESULT_IS_OK(res) && !SPA_RESULT_IS_ASYNC(res)) {
pw_param_update(&impl->param_list, &impl->pending_list, 0, NULL);
pi->user = 1;
}
else {
pw_param_clear(&impl->pending_list, SPA_ID_INVALID);
}
}
}