mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-12 13:30:15 -05:00
return -ENOENT when param doesn't exist
This commit is contained in:
parent
f46cbd2ac2
commit
2efa3f00ac
2 changed files with 16 additions and 8 deletions
|
|
@ -472,6 +472,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
uint32_t idx = 0, count = 0;
|
||||
struct param *p;
|
||||
bool found = false;
|
||||
|
||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||
|
||||
|
|
@ -488,15 +489,18 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
spa_list_for_each(p, &port->param_list, link) {
|
||||
struct spa_pod *param;
|
||||
|
||||
if (idx++ < start)
|
||||
continue;
|
||||
|
||||
idx++;
|
||||
result.index = result.next++;
|
||||
|
||||
param = p->param;
|
||||
if (param == NULL || p->id != id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
if (idx < start)
|
||||
continue;
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) != 0)
|
||||
continue;
|
||||
|
|
@ -506,7 +510,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
if (++count == num)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return found ? 0 : -ENOENT;
|
||||
}
|
||||
|
||||
static int update_params(struct filter *impl, struct port *port, uint32_t id,
|
||||
|
|
|
|||
|
|
@ -498,6 +498,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
uint32_t idx = 0, count = 0;
|
||||
struct param *p;
|
||||
bool found = false;
|
||||
|
||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||
|
||||
|
|
@ -511,15 +512,18 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
spa_list_for_each(p, &d->param_list, link) {
|
||||
struct spa_pod *param;
|
||||
|
||||
if (idx++ < start)
|
||||
continue;
|
||||
|
||||
idx++;
|
||||
result.index = result.next++;
|
||||
|
||||
param = p->param;
|
||||
if (param == NULL || p->id != id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
if (idx < start)
|
||||
continue;
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) != 0)
|
||||
continue;
|
||||
|
|
@ -529,7 +533,7 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
if (++count == num)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return found ? 0 : -ENOENT;
|
||||
}
|
||||
|
||||
static int map_data(struct stream *impl, struct spa_data *data, int prot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue