mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
modules: don't add CLIENT_ID when lingering
Because the object is not destroyed when the client is destroyed and so the client.id might become invalid.
This commit is contained in:
parent
d560628e2a
commit
962d3b9127
2 changed files with 9 additions and 11 deletions
|
|
@ -165,9 +165,11 @@ static void *create_object(void *_data,
|
||||||
pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
|
pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
|
||||||
pw_impl_factory_get_info(d->this)->id);
|
pw_impl_factory_get_info(d->this)->id);
|
||||||
|
|
||||||
client = resource ? pw_resource_get_client(resource): NULL;
|
str = pw_properties_get(properties, PW_KEY_OBJECT_LINGER);
|
||||||
|
linger = str ? pw_properties_parse_bool(str) : false;
|
||||||
|
|
||||||
if (client) {
|
client = resource ? pw_resource_get_client(resource): NULL;
|
||||||
|
if (client && !linger) {
|
||||||
pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
|
pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
|
||||||
pw_impl_client_get_info(client)->id);
|
pw_impl_client_get_info(client)->id);
|
||||||
}
|
}
|
||||||
|
|
@ -180,9 +182,6 @@ static void *create_object(void *_data,
|
||||||
|
|
||||||
pw_properties_setf(properties, "audio.adapt.follower", "pointer:%p", follower);
|
pw_properties_setf(properties, "audio.adapt.follower", "pointer:%p", follower);
|
||||||
}
|
}
|
||||||
str = pw_properties_get(properties, PW_KEY_OBJECT_LINGER);
|
|
||||||
linger = str ? pw_properties_parse_bool(str) : false;
|
|
||||||
|
|
||||||
if (follower == NULL) {
|
if (follower == NULL) {
|
||||||
factory_name = pw_properties_get(properties, SPA_KEY_FACTORY_NAME);
|
factory_name = pw_properties_get(properties, SPA_KEY_FACTORY_NAME);
|
||||||
if (factory_name == NULL)
|
if (factory_name == NULL)
|
||||||
|
|
|
||||||
|
|
@ -117,18 +117,17 @@ static void *create_object(void *_data,
|
||||||
if (factory_name == NULL)
|
if (factory_name == NULL)
|
||||||
goto error_properties;
|
goto error_properties;
|
||||||
|
|
||||||
client = resource ? pw_resource_get_client(resource) : NULL;
|
|
||||||
|
|
||||||
pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
|
pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
|
||||||
pw_global_get_id(pw_impl_factory_get_global(data->this)));
|
pw_global_get_id(pw_impl_factory_get_global(data->this)));
|
||||||
|
|
||||||
if (client) {
|
|
||||||
pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
|
|
||||||
pw_global_get_id(pw_impl_client_get_global(client)));
|
|
||||||
}
|
|
||||||
str = pw_properties_get(properties, PW_KEY_OBJECT_LINGER);
|
str = pw_properties_get(properties, PW_KEY_OBJECT_LINGER);
|
||||||
linger = str ? pw_properties_parse_bool(str) : false;
|
linger = str ? pw_properties_parse_bool(str) : false;
|
||||||
|
|
||||||
|
client = resource ? pw_resource_get_client(resource) : NULL;
|
||||||
|
if (client && !linger) {
|
||||||
|
pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
|
||||||
|
pw_global_get_id(pw_impl_client_get_global(client)));
|
||||||
|
}
|
||||||
node = pw_spa_node_load(context,
|
node = pw_spa_node_load(context,
|
||||||
factory_name,
|
factory_name,
|
||||||
PW_SPA_NODE_FLAG_ACTIVATE,
|
PW_SPA_NODE_FLAG_ACTIVATE,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue