Skip to content

Commit

Permalink
Store the registry as a struct pw_registry instead of a pw_proxy
Browse files Browse the repository at this point in the history
This is a better fix for flatpak#1611 and an improvement over flatpak#1624
as requested by @swick.
  • Loading branch information
antlarr committed Feb 12, 2025
1 parent da7b73b commit 8c67b22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ pipewire_remote_destroy (PipeWireRemote *remote)
/* This check is a workaround for older PW versions */
if (remote->registry)
spa_hook_remove (&remote->registry_listener);
g_clear_pointer (&remote->registry, pw_proxy_destroy);
pw_proxy_destroy((struct pw_proxy *)remote->registry);
remote->registry = NULL;
g_clear_pointer (&remote->globals, g_hash_table_destroy);
if (remote->core)
spa_hook_remove (&remote->core_listener);
Expand Down Expand Up @@ -328,10 +329,10 @@ pipewire_remote_new_sync (struct pw_properties *pipewire_properties,
&core_events,
remote);

remote->registry = (struct pw_proxy*) pw_core_get_registry (remote->core,
PW_VERSION_REGISTRY,
0);
pw_registry_add_listener ((struct pw_registry*)remote->registry,
remote->registry = pw_core_get_registry (remote->core,
PW_VERSION_REGISTRY,
0);
pw_registry_add_listener (remote->registry,
&remote->registry_listener,
&registry_events,
remote);
Expand Down
2 changes: 1 addition & 1 deletion src/pipewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct _PipeWireRemote

int sync_seq;

struct pw_proxy *registry;
struct pw_registry *registry;
struct spa_hook registry_listener;

GHashTable *globals;
Expand Down

0 comments on commit 8c67b22

Please sign in to comment.