link: fix negotiation

Don't use the current best format as a filter to get the current format.
It might be different and then we fail.
This commit is contained in:
Wim Taymans 2018-10-16 17:12:12 +02:00
parent d91e545e1d
commit e079552dc8

View file

@ -213,7 +213,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
if ((res = spa_node_port_enum_params(output->node->node, if ((res = spa_node_port_enum_params(output->node->node,
output->direction, output->port_id, output->direction, output->port_id,
SPA_PARAM_Format, &index, SPA_PARAM_Format, &index,
format, &current, &b)) <= 0) { NULL, &current, &b)) <= 0) {
if (res == 0) if (res == 0)
res = -EBADF; res = -EBADF;
asprintf(&error, "error get output format: %s", spa_strerror(res)); asprintf(&error, "error get output format: %s", spa_strerror(res));
@ -238,7 +238,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
if ((res = spa_node_port_enum_params(input->node->node, if ((res = spa_node_port_enum_params(input->node->node,
input->direction, input->port_id, input->direction, input->port_id,
SPA_PARAM_Format, &index, SPA_PARAM_Format, &index,
format, &current, &b)) <= 0) { NULL, &current, &b)) <= 0) {
if (res == 0) if (res == 0)
res = -EBADF; res = -EBADF;
asprintf(&error, "error get input format: %s", spa_strerror(res)); asprintf(&error, "error get input format: %s", spa_strerror(res));