mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-07-21 10:16:14 +00:00
pipewire: pw_proxy_init(): take pointer to core
`pw_proxy::core` must be initialized for `pw_proxy_init()` to succeed, so take it as a parameter instead of relying on the caller to initialize that field beforehand.
This commit is contained in:
parent
e299534929
commit
4bec3b56d4
|
@ -317,7 +317,6 @@ static struct pw_core *core_new(struct pw_context *context,
|
|||
|
||||
pw_properties_add(properties, &context->properties->dict);
|
||||
|
||||
p->proxy.core = p;
|
||||
p->context = context;
|
||||
p->properties = properties;
|
||||
p->pool = pw_mempool_new(NULL);
|
||||
|
@ -343,7 +342,7 @@ static struct pw_core *core_new(struct pw_context *context,
|
|||
if (p->conn == NULL)
|
||||
goto error_connection;
|
||||
|
||||
if ((res = pw_proxy_init(&p->proxy, PW_TYPE_INTERFACE_Core, PW_VERSION_CORE)) < 0)
|
||||
if ((res = pw_proxy_init(&p->proxy, p, PW_TYPE_INTERFACE_Core, PW_VERSION_CORE)) < 0)
|
||||
goto error_proxy;
|
||||
|
||||
p->client = (struct pw_client*)pw_proxy_new(&p->proxy,
|
||||
|
|
|
@ -1230,7 +1230,7 @@ int pw_context_debug_port_params(struct pw_context *context,
|
|||
|
||||
const struct pw_export_type *pw_context_find_export_type(struct pw_context *context, const char *type);
|
||||
|
||||
int pw_proxy_init(struct pw_proxy *proxy, const char *type, uint32_t version);
|
||||
int pw_proxy_init(struct pw_proxy *proxy, struct pw_core *core, const char *type, uint32_t version);
|
||||
|
||||
void pw_proxy_remove(struct pw_proxy *proxy);
|
||||
|
||||
|
|
|
@ -21,10 +21,11 @@ struct proxy {
|
|||
};
|
||||
/** \endcond */
|
||||
|
||||
int pw_proxy_init(struct pw_proxy *proxy, const char *type, uint32_t version)
|
||||
int pw_proxy_init(struct pw_proxy *proxy, struct pw_core *core, const char *type, uint32_t version)
|
||||
{
|
||||
int res;
|
||||
|
||||
proxy->core = core;
|
||||
proxy->refcount = 1;
|
||||
proxy->type = type;
|
||||
proxy->version = version;
|
||||
|
@ -81,9 +82,8 @@ struct pw_proxy *pw_proxy_new(struct pw_proxy *factory,
|
|||
return NULL;
|
||||
|
||||
this = &impl->this;
|
||||
this->core = factory->core;
|
||||
|
||||
if ((res = pw_proxy_init(this, type, version)) < 0)
|
||||
if ((res = pw_proxy_init(this, factory->core, type, version)) < 0)
|
||||
goto error_init;
|
||||
|
||||
if (user_data_size > 0)
|
||||
|
|
Loading…
Reference in a new issue