mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
handle core error better
Use the PW_ID_CORE constant Quit the mainloop when server disconnected in the tools See #395
This commit is contained in:
parent
387009e0d6
commit
b3aa346063
11 changed files with 13 additions and 20 deletions
|
|
@ -346,10 +346,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PA_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(impl->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -502,10 +502,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PA_ID_CORE
|
||||
pw_main_loop_quit(d->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -494,10 +494,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PA_ID_CORE
|
||||
pw_main_loop_quit(d->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -77,10 +77,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PA_ID_CORE)
|
||||
pw_main_loop_quit(d->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -111,10 +111,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PA_ID_CORE)
|
||||
pw_main_loop_quit(d->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -635,6 +635,7 @@ static void on_core_error(void *userdata, uint32_t id, int seq, int res, const c
|
|||
fprintf(stderr, "remote error: id=%"PRIu32" seq:%d res:%d (%s): %s\n",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == PW_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(data->loop);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -413,10 +413,9 @@ static void on_core_error(void *_data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("remote %p: error id:%u seq:%d res:%d (%s): %s", rd,
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PW_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(data->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events remote_core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -727,10 +727,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PW_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(d->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -146,10 +146,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == 0) {
|
||||
if (id == PW_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(d->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -662,10 +662,10 @@ static void on_core_error(void *_data, uint32_t id, int seq, int res, const char
|
|||
|
||||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
if (id == 0) {
|
||||
|
||||
if (id == PW_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(data->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ static void on_core_error(void *_data, uint32_t id, int seq, int res, const char
|
|||
pw_log_error("error id:%u seq:%d res:%d (%s): %s",
|
||||
id, seq, res, spa_strerror(res), message);
|
||||
|
||||
if (id == PW_ID_CORE)
|
||||
if (id == PW_ID_CORE && res == -EPIPE)
|
||||
pw_main_loop_quit(data->loop);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue