impl-port: handle tags like latency

No links on the port will result in a NULL tag and >0 links will always
result in a non-NULL tag (that could be empty).

This makes it easier to see when a port is linked or not.
This commit is contained in:
Wim Taymans 2025-11-05 11:26:23 +01:00
parent ffb7663f4d
commit fc55ceb2f4

View file

@ -1874,25 +1874,23 @@ int pw_impl_port_recalc_tag(struct pw_impl_port *port)
tag = other->tag[other->direction];
if (tag) {
void *state = NULL;
while (spa_tag_parse(tag, &info, &state) == 1) {
while (spa_tag_parse(tag, &info, &state) == 1)
spa_tag_build_add_info(&b.b, info.info);
}
count++;
}
}
}
} else {
spa_list_for_each(l, &port->links, input_link) {
other = l->output;
tag = other->tag[other->direction];
if (tag) {
void *state = NULL;
while (spa_tag_parse(tag, &info, &state) == 1) {
while (spa_tag_parse(tag, &info, &state) == 1)
spa_tag_build_add_info(&b.b, info.info);
}
count++;
}
}
}
}
param = count == 0 ? NULL : spa_tag_build_end(&b.b, &f);
old = port->tag[direction];