link: handle the right port in the callback

This commit is contained in:
Wim Taymans 2019-02-21 10:30:40 +01:00
parent 7b12212eeb
commit a3ca2df0fe
4 changed files with 9 additions and 6 deletions

View file

@ -1251,17 +1251,18 @@ static void client_node_resource_done(void *data, uint32_t seq)
struct impl *impl = data; struct impl *impl = data;
struct node *this = &impl->node; struct node *this = &impl->node;
struct spa_pending *p, *t; struct spa_pending *p, *t;
uint32_t count = 0;
pw_log_debug("client-node %p: done %d", this, seq);
spa_list_for_each_safe(p, t, &this->pending_list, link) { spa_list_for_each_safe(p, t, &this->pending_list, link) {
pw_log_debug("client-node %p: check %d", this, p->seq);
if (p->seq == (int) seq) { if (p->seq == (int) seq) {
pw_log_debug("client-node %p: found %d", this, p->res); pw_log_debug("client-node %p: do callback %d", this, p->res);
p->func(p->data, p->res, 0, NULL); p->func(p->data, p->res, 0, NULL);
spa_list_remove(&p->link); spa_list_remove(&p->link);
count++;
} }
} }
if (count == 0)
pw_log_warn("client-node %p: unhandled done %d", this, seq);
} }
void pw_client_node_registered(struct pw_client_node *this, uint32_t node_id) void pw_client_node_registered(struct pw_client_node *this, uint32_t node_id)

View file

@ -227,6 +227,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
case SPA_PARAM_Profile: case SPA_PARAM_Profile:
if (impl->started) if (impl->started)
return -EIO; return -EIO;
pw_log_debug("set profile %d", id);
if (impl->adapter != impl->cnode) { if (impl->adapter != impl->cnode) {
if ((res = spa_node_set_param(impl->adapter, id, flags, param)) < 0) if ((res = spa_node_set_param(impl->adapter, id, flags, param)) < 0)
return res; return res;

View file

@ -165,7 +165,7 @@ static int complete_input(void *data, int seq, int res, const void *result)
{ {
struct pw_link *this = data; struct pw_link *this = data;
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
struct pw_node *node = this->output->node; struct pw_node *node = this->input->node;
seq = SPA_RESULT_ASYNC_SEQ(seq); seq = SPA_RESULT_ASYNC_SEQ(seq);
pw_log_debug("link %p: node %p async complete %d %d", impl, node, seq, res); pw_log_debug("link %p: node %p async complete %d %d", impl, node, seq, res);
pw_work_queue_complete(impl->work, node, seq, res); pw_work_queue_complete(impl->work, node, seq, res);

View file

@ -1146,7 +1146,8 @@ pw_node_find_port(struct pw_node *node, enum pw_direction direction, uint32_t po
port = p; port = p;
} }
} }
pw_log_debug("node %p: return port %p", node, port); pw_log_debug("node %p: return %s port %d: %p", node,
pw_direction_as_string(direction), port_id, port);
return port; return port;
} }