mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: if all transport methods failed, fail server creation
No point in keeping a server running if it doesn't listen to anything.
This commit is contained in:
parent
3aacc719b2
commit
6d19dd0162
1 changed files with 7 additions and 1 deletions
|
|
@ -6234,6 +6234,7 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context,
|
||||||
struct spa_cpu *cpu;
|
struct spa_cpu *cpu;
|
||||||
uint32_t n_support;
|
uint32_t n_support;
|
||||||
int res;
|
int res;
|
||||||
|
size_t ncreated = 0;
|
||||||
|
|
||||||
impl = calloc(1, sizeof(struct impl) + user_data_size);
|
impl = calloc(1, sizeof(struct impl) + user_data_size);
|
||||||
if (impl == NULL)
|
if (impl == NULL)
|
||||||
|
|
@ -6291,12 +6292,17 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context,
|
||||||
spa_json_init(&it[0], str, strlen(str));
|
spa_json_init(&it[0], str, strlen(str));
|
||||||
if (spa_json_enter_array(&it[0], &it[1]) > 0) {
|
if (spa_json_enter_array(&it[0], &it[1]) > 0) {
|
||||||
while (spa_json_get_string(&it[1], value, sizeof(value)-1) > 0) {
|
while (spa_json_get_string(&it[1], value, sizeof(value)-1) > 0) {
|
||||||
if (create_server(impl, value) == NULL) {
|
if (create_server(impl, value)) {
|
||||||
|
ncreated++;
|
||||||
|
} else {
|
||||||
pw_log_warn(NAME" %p: can't create server for %s: %m",
|
pw_log_warn(NAME" %p: can't create server for %s: %m",
|
||||||
impl, value);
|
impl, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ncreated == 0)
|
||||||
|
goto error_free;
|
||||||
|
|
||||||
if ((res = create_pid_file()) < 0) {
|
if ((res = create_pid_file()) < 0) {
|
||||||
pw_log_warn(NAME" %p: can't create pid file: %s",
|
pw_log_warn(NAME" %p: can't create pid file: %s",
|
||||||
impl, spa_strerror(res));
|
impl, spa_strerror(res));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue