mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-20 01:50:04 +01:00
pipewire-object-mixin: Copy the props instead of wrapping them
This allows users to have full control of the properties when they get them.
This commit is contained in:
parent
c68eb59017
commit
2712cbb5a9
2 changed files with 1 additions and 2 deletions
|
|
@ -783,7 +783,7 @@ wp_pw_object_mixin_handle_event_info (gpointer instance, gconstpointer update)
|
||||||
G_STRUCT_MEMBER (const struct spa_dict *, d->info, iface->props_offset);
|
G_STRUCT_MEMBER (const struct spa_dict *, d->info, iface->props_offset);
|
||||||
|
|
||||||
g_clear_pointer (&d->properties, wp_properties_unref);
|
g_clear_pointer (&d->properties, wp_properties_unref);
|
||||||
d->properties = wp_properties_new_wrap_dict (props);
|
d->properties = wp_properties_new_copy_dict (props);
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (instance), "properties");
|
g_object_notify (G_OBJECT (instance), "properties");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,6 @@ test_node (TestFixture *f, gconstpointer data)
|
||||||
|
|
||||||
props = wp_pipewire_object_get_properties (proxy);
|
props = wp_pipewire_object_get_properties (proxy);
|
||||||
g_assert_nonnull (props);
|
g_assert_nonnull (props);
|
||||||
g_assert_true (wp_properties_peek_dict (props) == info->props);
|
|
||||||
id = wp_properties_get (props, PW_KEY_OBJECT_ID);
|
id = wp_properties_get (props, PW_KEY_OBJECT_ID);
|
||||||
g_assert_nonnull (id);
|
g_assert_nonnull (id);
|
||||||
g_assert_cmpint (info->id, ==, atoi(id));
|
g_assert_cmpint (info->id, ==, atoi(id));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue