bluez5: always emit node object info for dynamic node

impl_add_listener() could be called more than one time, ensure that we always emit node info
so that session manager(bluez-monitor) can receives it.

Fixes #1308
This commit is contained in:
Huang-Huang Bao 2021-06-14 20:06:37 +08:00 committed by Wim Taymans
parent 62e98aa836
commit 4c9ac08310

View file

@ -506,8 +506,14 @@ static const struct spa_bt_transport_events dynamic_node_transport_events = {
static void emit_dynamic_node(struct dynamic_node *this, struct impl *impl, static void emit_dynamic_node(struct dynamic_node *this, struct impl *impl,
struct spa_bt_transport *t, uint32_t id, const char *factory_name) struct spa_bt_transport *t, uint32_t id, const char *factory_name)
{ {
if (this->transport != NULL) spa_log_debug(impl->log, NAME": dynamic node, transport: %p->%p id: %08x->%08x",
return; this->transport, t, this->id, id);
if (this->transport) {
/* Session manager don't really handles transport ptr changing. */
spa_assert(this->transport == t);
spa_hook_remove(&this->transport_listener);
}
this->impl = impl; this->impl = impl;
this->transport = t; this->transport = t;