mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
remote: only load protocol when not already loaded
This commit is contained in:
parent
7a4a8d78b9
commit
638ee33f44
1 changed files with 12 additions and 8 deletions
|
|
@ -184,7 +184,7 @@ struct pw_remote *pw_remote_new(struct pw_core *core,
|
||||||
{
|
{
|
||||||
struct remote *impl;
|
struct remote *impl;
|
||||||
struct pw_remote *this;
|
struct pw_remote *this;
|
||||||
struct pw_protocol *protocol;
|
struct pw_protocol *protocol = NULL;
|
||||||
const char *protocol_name;
|
const char *protocol_name;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
|
@ -220,16 +220,20 @@ struct pw_remote *pw_remote_new(struct pw_core *core,
|
||||||
spa_hook_list_init(&this->listener_list);
|
spa_hook_list_init(&this->listener_list);
|
||||||
|
|
||||||
if ((protocol_name = pw_properties_get(properties, PW_KEY_PROTOCOL)) == NULL) {
|
if ((protocol_name = pw_properties_get(properties, PW_KEY_PROTOCOL)) == NULL) {
|
||||||
if (pw_module_load(core, "libpipewire-module-protocol-native",
|
if ((protocol_name = pw_properties_get(core->properties, PW_KEY_PROTOCOL)) == NULL) {
|
||||||
NULL, NULL) == NULL) {
|
protocol_name = PW_TYPE_INFO_PROTOCOL_Native;
|
||||||
res = -errno;
|
if ((protocol = pw_core_find_protocol(core, protocol_name)) == NULL) {
|
||||||
goto error_protocol;
|
if (pw_module_load(core, "libpipewire-module-protocol-native",
|
||||||
|
NULL, NULL) == NULL) {
|
||||||
|
res = -errno;
|
||||||
|
goto error_protocol;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol_name = PW_TYPE_INFO_PROTOCOL_Native;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol = pw_core_find_protocol(core, protocol_name);
|
if (protocol == NULL)
|
||||||
|
protocol = pw_core_find_protocol(core, protocol_name);
|
||||||
if (protocol == NULL) {
|
if (protocol == NULL) {
|
||||||
res = -ENOTSUP;
|
res = -ENOTSUP;
|
||||||
goto error_protocol;
|
goto error_protocol;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue