jack: make sure we can always find our own ports

find_port_by_name() is used to find our own ports before they become
visible so make sure we can always find them.

Fixes #3485
This commit is contained in:
Wim Taymans 2023-08-24 19:28:57 +02:00
parent 32084ff3c6
commit c41c812325

View file

@ -719,12 +719,20 @@ static bool is_port_default(struct client *c, struct object *o)
return false;
}
static inline bool client_port_visible(struct client *c, struct object *o)
{
if (o->port.port != NULL && o->port.port->client == c)
return true;
return o->visible;
}
static struct object *find_port_by_name(struct client *c, const char *name)
{
struct object *o;
spa_list_for_each(o, &c->context.objects, link) {
if (o->type != INTERFACE_Port || o->removed || !o->visible)
if (o->type != INTERFACE_Port || o->removed ||
(!client_port_visible(c, o)))
continue;
if (spa_streq(o->port.name, name) ||
spa_streq(o->port.alias1, name) ||