mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
remote: take ownership of properties in _export()
pw_remote_export() takes ownership of the properties so implement this in the device and spa_node export functions. Fixes #187
This commit is contained in:
parent
50fc65a07e
commit
68fc530d9c
3 changed files with 15 additions and 4 deletions
|
|
@ -68,10 +68,12 @@ struct pw_proxy *pw_remote_spa_device_export(struct pw_remote *remote,
|
||||||
"client-device",
|
"client-device",
|
||||||
SPA_TYPE_INTERFACE_Device,
|
SPA_TYPE_INTERFACE_Device,
|
||||||
SPA_VERSION_DEVICE,
|
SPA_VERSION_DEVICE,
|
||||||
&props->dict,
|
props ? &props->dict : NULL,
|
||||||
user_data_size + sizeof(struct device_data));
|
user_data_size + sizeof(struct device_data));
|
||||||
|
if (props)
|
||||||
|
pw_properties_free(props);
|
||||||
if (proxy == NULL)
|
if (proxy == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
data = pw_proxy_get_user_data(proxy);
|
data = pw_proxy_get_user_data(proxy);
|
||||||
data = SPA_MEMBER(data, user_data_size, struct device_data);
|
data = SPA_MEMBER(data, user_data_size, struct device_data);
|
||||||
|
|
|
||||||
|
|
@ -1149,6 +1149,12 @@ struct pw_proxy *pw_remote_node_export(struct pw_remote *remote,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, struct pw_properties *props, void *object,
|
||||||
size_t user_data_size)
|
size_t user_data_size)
|
||||||
{
|
{
|
||||||
|
struct pw_node *node = object;
|
||||||
|
|
||||||
|
if (props) {
|
||||||
|
pw_node_update_properties(node, &props->dict);
|
||||||
|
pw_properties_free(props);
|
||||||
|
}
|
||||||
return node_export(remote, object, false, user_data_size);
|
return node_export(remote, object, false, user_data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -545,13 +545,16 @@ struct pw_proxy *pw_remote_export(struct pw_remote *remote,
|
||||||
|
|
||||||
error_core_proxy:
|
error_core_proxy:
|
||||||
pw_log_error(NAME" %p: no core proxy: %s", remote, spa_strerror(res));
|
pw_log_error(NAME" %p: no core proxy: %s", remote, spa_strerror(res));
|
||||||
goto exit;
|
goto exit_free;
|
||||||
error_export_type:
|
error_export_type:
|
||||||
pw_log_error(NAME" %p: can't export type %d: %s", remote, type, spa_strerror(res));
|
pw_log_error(NAME" %p: can't export type %d: %s", remote, type, spa_strerror(res));
|
||||||
goto exit;
|
goto exit_free;
|
||||||
error_proxy_failed:
|
error_proxy_failed:
|
||||||
pw_log_error(NAME" %p: failed to create proxy: %s", remote, spa_strerror(res));
|
pw_log_error(NAME" %p: failed to create proxy: %s", remote, spa_strerror(res));
|
||||||
goto exit;
|
goto exit;
|
||||||
|
exit_free:
|
||||||
|
if (props)
|
||||||
|
pw_properties_free(props);
|
||||||
exit:
|
exit:
|
||||||
errno = -res;
|
errno = -res;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue