media-session: set bluetooth volume directly on the local adapter node

Avoid problems with session proxy appearing too late by setting props on
directly on the local SPA node.
This commit is contained in:
Pauli Virtanen 2021-02-16 23:40:31 +02:00
parent c7ad443e03
commit d9c5ea54fd

View file

@ -292,19 +292,10 @@ static void bluez_device_event(void *data, const struct spa_event *event)
switch (type) { switch (type) {
case SPA_DEVICE_EVENT_ObjectConfig: case SPA_DEVICE_EVENT_ObjectConfig:
/* FIXME, proxy might be NULL at this point until the
* node proxy is created. We should probably do
* pw_client_node_get_node() and perform the set_param on
* that node proxy instead of waiting for the session manager
* proxy. */
if (props != NULL) { if (props != NULL) {
if (node->snode->obj.proxy != NULL) { struct spa_node *adapter;
pw_node_set_param((struct pw_node*)node->snode->obj.proxy, adapter = pw_impl_node_get_implementation(node->adapter);
SPA_PARAM_Props, 0, props); spa_node_set_param(adapter, SPA_PARAM_Props, 0, props);
} else {
pw_log_warn("device %p: node %d object:%p not ready for volume yet",
device, id, node->snode);
}
} }
break; break;
default: default: