mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
session-manager: check error code when registering the marshallers
This commit is contained in:
parent
e971a79fce
commit
0a8ec0380b
2 changed files with 8 additions and 7 deletions
|
|
@ -32,7 +32,7 @@ int client_endpoint_factory_init(struct pw_impl_module *module);
|
|||
/* client-session.c */
|
||||
int client_session_factory_init(struct pw_impl_module *module);
|
||||
/* protocol-native.c */
|
||||
struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_context *context);
|
||||
int pw_protocol_native_ext_session_manager_init(struct pw_context *context);
|
||||
|
||||
static const struct spa_dict_item module_props[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "George Kiagiadakis <george.kiagiadakis@collabora.com>" },
|
||||
|
|
@ -44,12 +44,14 @@ SPA_EXPORT
|
|||
int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||
{
|
||||
struct pw_context *context = pw_impl_module_get_context(module);
|
||||
int res;
|
||||
|
||||
if ((res = pw_protocol_native_ext_session_manager_init(context)) < 0)
|
||||
return res;
|
||||
|
||||
client_endpoint_factory_init(module);
|
||||
client_session_factory_init(module);
|
||||
|
||||
pw_protocol_native_ext_session_manager_init(context);
|
||||
|
||||
pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -3039,14 +3039,13 @@ static const struct pw_protocol_marshal pw_protocol_native_session_impl_marshal
|
|||
.client_demarshal = pw_protocol_native_session_client_method_demarshal,
|
||||
};
|
||||
|
||||
struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_context *context)
|
||||
int pw_protocol_native_ext_session_manager_init(struct pw_context *context)
|
||||
{
|
||||
struct pw_protocol *protocol;
|
||||
|
||||
protocol = pw_context_find_protocol(context, PW_TYPE_INFO_PROTOCOL_Native);
|
||||
|
||||
if (protocol == NULL)
|
||||
return NULL;
|
||||
return -EPROTO;
|
||||
|
||||
/* deprecated */
|
||||
pw_protocol_add_marshal(protocol, &pw_protocol_native_client_endpoint_marshal);
|
||||
|
|
@ -3064,5 +3063,5 @@ struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_contex
|
|||
pw_protocol_add_marshal(protocol, &pw_protocol_native_endpoint_impl_marshal);
|
||||
pw_protocol_add_marshal(protocol, &pw_protocol_native_session_impl_marshal);
|
||||
|
||||
return protocol;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue