diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index dfebefe79..c7613041c 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -620,7 +620,7 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static const struct spa_dict_item node_info_items[] = { { SPA_KEY_DEVICE_API, "bluez5" }, - { SPA_KEY_MEDIA_CLASS, "Audio/Source" }, + { SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" }, { SPA_KEY_NODE_DRIVER, "true" }, { SPA_KEY_NODE_LATENCY, "512/48000" }, }; diff --git a/src/examples/media-session/policy-node.c b/src/examples/media-session/policy-node.c index 32a31f5a1..01fba97f3 100644 --- a/src/examples/media-session/policy-node.c +++ b/src/examples/media-session/policy-node.c @@ -546,7 +546,7 @@ static int rescan_node(struct impl *impl, struct node *n) { struct spa_dict *props; const char *str; - bool exclusive, reconnect; + bool exclusive, reconnect, autoconnect; struct find_data find; struct pw_node_info *info; struct node *peer; @@ -582,8 +582,15 @@ static int rescan_node(struct impl *impl, struct node *n) if ((str = spa_dict_lookup(props, PW_KEY_STREAM_MONITOR)) != NULL) n->monitor = pw_properties_parse_bool(str); - str = spa_dict_lookup(props, PW_KEY_NODE_AUTOCONNECT); - if (str == NULL || !pw_properties_parse_bool(str)) { + autoconnect = false; + if ((str = spa_dict_lookup(props, PW_KEY_NODE_AUTOCONNECT)) != NULL) + autoconnect = pw_properties_parse_bool(str); + + if ((str = spa_dict_lookup(props, PW_KEY_DEVICE_API)) != NULL && + strcmp(str, "bluez5") == 0) + autoconnect = true; + + if (!autoconnect) { pw_log_debug(NAME" %p: node %d does not need autoconnect", impl, n->id); configure_node(n, NULL, false); return 0;