mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
stream: clean up enum_params
This commit is contained in:
parent
2efa3f00ac
commit
22cc1f903f
2 changed files with 8 additions and 12 deletions
|
|
@ -470,14 +470,14 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
struct spa_result_node_params result;
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = { 0 };
|
||||
uint32_t idx = 0, count = 0;
|
||||
uint32_t count = 0;
|
||||
struct param *p;
|
||||
bool found = false;
|
||||
|
||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||
|
||||
result.id = id;
|
||||
result.next = start;
|
||||
result.next = 0;
|
||||
|
||||
if ((port = get_port(d, direction, port_id)) == NULL)
|
||||
return -EINVAL;
|
||||
|
|
@ -489,8 +489,9 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
spa_list_for_each(p, &port->param_list, link) {
|
||||
struct spa_pod *param;
|
||||
|
||||
idx++;
|
||||
result.index = result.next++;
|
||||
if (result.index < start)
|
||||
continue;
|
||||
|
||||
param = p->param;
|
||||
if (param == NULL || p->id != id)
|
||||
|
|
@ -498,9 +499,6 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -496,14 +496,14 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
struct spa_result_node_params result;
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = { 0 };
|
||||
uint32_t idx = 0, count = 0;
|
||||
uint32_t count = 0;
|
||||
struct param *p;
|
||||
bool found = false;
|
||||
|
||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||
|
||||
result.id = id;
|
||||
result.next = start;
|
||||
result.next = 0;
|
||||
|
||||
pw_log_debug(NAME" %p: param id %d (%s) start:%d num:%d", d, id,
|
||||
spa_debug_type_find_name(spa_type_param, id),
|
||||
|
|
@ -512,8 +512,9 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
spa_list_for_each(p, &d->param_list, link) {
|
||||
struct spa_pod *param;
|
||||
|
||||
idx++;
|
||||
result.index = result.next++;
|
||||
if (result.index < start)
|
||||
continue;
|
||||
|
||||
param = p->param;
|
||||
if (param == NULL || p->id != id)
|
||||
|
|
@ -521,9 +522,6 @@ static int impl_port_enum_params(void *object, int seq,
|
|||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue