mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
buffers: handle -ENOENT
enum_param should return -ENOENT when the param is not known. When negotiating buffers handle -ENOENT. This means the port does not know about the property and we should assume anything is fine so just use the filter from the first port.
This commit is contained in:
parent
b6a6d1f0bb
commit
463b9e4e29
2 changed files with 13 additions and 5 deletions
|
|
@ -280,6 +280,7 @@ static int impl_node_enum_params(void *object, int seq,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
struct spa_result_node_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||
|
|
@ -299,6 +300,7 @@ static int impl_node_enum_params(void *object, int seq,
|
|||
if (param == NULL || !spa_pod_is_object_id(param, id))
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) != 0)
|
||||
continue;
|
||||
|
|
@ -309,7 +311,7 @@ static int impl_node_enum_params(void *object, int seq,
|
|||
if (++count == num)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return found ? 0 : -ENOENT;
|
||||
}
|
||||
|
||||
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||
|
|
@ -558,6 +560,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
struct spa_result_node_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||
|
|
@ -583,6 +586,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
if (param == NULL || !spa_pod_is_object_id(param, id))
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
|
||||
continue;
|
||||
|
|
@ -593,7 +597,7 @@ impl_node_port_enum_params(void *object, int seq,
|
|||
if (++count == num)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return found ? 0 : -ENOENT;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -179,12 +179,16 @@ param_filter(struct pw_buffers *this,
|
|||
|
||||
for (oidx = 0;;) {
|
||||
pw_log_debug(NAME" %p: output param %d id:%d", this, oidx, id);
|
||||
if (spa_node_port_enum_params_sync(out_port->node,
|
||||
res = spa_node_port_enum_params_sync(out_port->node,
|
||||
out_port->direction, out_port->port_id,
|
||||
id, &oidx, iparam, &oparam, result) != 1) {
|
||||
id, &oidx, iparam, &oparam, result);
|
||||
if (res != 1) {
|
||||
if (res == -ENOENT && iparam) {
|
||||
spa_pod_builder_raw_padded(result, iparam, SPA_POD_SIZE(iparam));
|
||||
num++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(2, NULL, oparam);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue