mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
resource: destroy old core_resource
If there is already a core_resource when we are going to make a new one, remove the old one. This can happen when there is a version switch.
This commit is contained in:
parent
905e5af058
commit
d2e7f75071
4 changed files with 8 additions and 2 deletions
|
|
@ -320,6 +320,9 @@ static void on_start(void *data, uint32_t version)
|
||||||
|
|
||||||
pw_log_debug("version %d", version);
|
pw_log_debug("version %d", version);
|
||||||
|
|
||||||
|
if (client->core_resource != NULL)
|
||||||
|
pw_resource_remove(client->core_resource);
|
||||||
|
|
||||||
if (pw_global_bind(pw_impl_core_get_global(client->core), client,
|
if (pw_global_bind(pw_impl_core_get_global(client->core), client,
|
||||||
PW_PERM_RWX, version, 0) < 0)
|
PW_PERM_RWX, version, 0) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -952,8 +952,6 @@ int pw_proxy_init(struct pw_proxy *proxy, const char *type, uint32_t version);
|
||||||
|
|
||||||
void pw_proxy_remove(struct pw_proxy *proxy);
|
void pw_proxy_remove(struct pw_proxy *proxy);
|
||||||
|
|
||||||
void pw_resource_remove(struct pw_resource *resource);
|
|
||||||
|
|
||||||
int pw_context_recalc_graph(struct pw_context *context);
|
int pw_context_recalc_graph(struct pw_context *context);
|
||||||
|
|
||||||
void pw_impl_port_update_info(struct pw_impl_port *port, const struct spa_port_info *info);
|
void pw_impl_port_update_info(struct pw_impl_port *port, const struct spa_port_info *info);
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,7 @@ void pw_resource_destroy(struct pw_resource *resource)
|
||||||
free(resource);
|
free(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPA_EXPORT
|
||||||
void pw_resource_remove(struct pw_resource *resource)
|
void pw_resource_remove(struct pw_resource *resource)
|
||||||
{
|
{
|
||||||
resource->removed = true;
|
resource->removed = true;
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,10 @@ pw_resource_new(struct pw_impl_client *client, /**< the client owning the resour
|
||||||
/** Destroy a resource */
|
/** Destroy a resource */
|
||||||
void pw_resource_destroy(struct pw_resource *resource);
|
void pw_resource_destroy(struct pw_resource *resource);
|
||||||
|
|
||||||
|
/** Remove a resource, like pw_resource_destroy but without sending a
|
||||||
|
* remove_id message to the client */
|
||||||
|
void pw_resource_remove(struct pw_resource *resource);
|
||||||
|
|
||||||
/** Get the client owning this resource */
|
/** Get the client owning this resource */
|
||||||
struct pw_impl_client *pw_resource_get_client(struct pw_resource *resource);
|
struct pw_impl_client *pw_resource_get_client(struct pw_resource *resource);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue