avb: reply with advertise to discover

This commit is contained in:
Wim Taymans 2022-04-06 17:12:57 +02:00
parent a34417eed0
commit dec2bdf241

View file

@ -139,12 +139,15 @@ static int adp_message(void *data, uint64_t now, const void *message, int len)
}
break;
case AVB_ADP_MESSAGE_TYPE_ENTITY_DISCOVER:
if (entity_id == 0UL ||
(e != NULL && e->advertise &&
be64toh(e->packet.entity_id) == entity_id)) {
pw_log_info("entity %s discover",
pw_log_info("entity %s advertise",
avb_utils_format_id(buf, sizeof(buf), entity_id));
send_discover(adp, entity_id);
if (entity_id == 0UL) {
spa_list_for_each(e, &adp->entities, link)
if (e->advertise)
send_advertise(adp, now, e);
} else if (e != NULL && e->advertise &&
be64toh(e->packet.entity_id) == entity_id) {
send_advertise(adp, now, e);
}
break;
default: