remote: notify error

Don't fail on errors but emit a signal
This commit is contained in:
Wim Taymans 2018-10-03 19:30:06 +02:00
parent f3dfe61aa0
commit ea739df26f
3 changed files with 6 additions and 1 deletions

View file

@ -530,6 +530,7 @@ struct pw_proxy {
#define pw_remote_events_info_changed(r,i) pw_remote_events_emit(r, info_changed, 0, i) #define pw_remote_events_info_changed(r,i) pw_remote_events_emit(r, info_changed, 0, i)
#define pw_remote_events_sync_reply(r,s) pw_remote_events_emit(r, sync_reply, 0, s) #define pw_remote_events_sync_reply(r,s) pw_remote_events_emit(r, sync_reply, 0, s)
#define pw_remote_events_state_changed(r,o,s,e) pw_remote_events_emit(r, state_changed, 0, o, s, e) #define pw_remote_events_state_changed(r,o,s,e) pw_remote_events_emit(r, state_changed, 0, o, s, e)
#define pw_remote_events_error(r,i,res,e) pw_remote_events_emit(r, error, 0, i, res, e)
struct pw_remote { struct pw_remote {
struct pw_core *core; /**< core */ struct pw_core *core; /**< core */

View file

@ -189,7 +189,9 @@ static void core_event_done(void *data, uint32_t seq)
static void core_event_error(void *data, uint32_t id, int res, const char *error, ...) static void core_event_error(void *data, uint32_t id, int res, const char *error, ...)
{ {
struct pw_remote *this = data; struct pw_remote *this = data;
pw_remote_update_state(this, PW_REMOTE_STATE_ERROR, error); pw_log_warn("remote %p: got error %d, %d (%s): %s", this,
id, res, spa_strerror(res), error);
pw_remote_events_error(this, id, res, error);
} }
static void core_event_remove_id(void *data, uint32_t id) static void core_event_remove_id(void *data, uint32_t id)

View file

@ -136,6 +136,8 @@ struct pw_remote_events {
/** emited when the state changes */ /** emited when the state changes */
void (*state_changed) (void *data, enum pw_remote_state old, void (*state_changed) (void *data, enum pw_remote_state old,
enum pw_remote_state state, const char *error); enum pw_remote_state state, const char *error);
/** emited when an error was reported */
void (*error) (void *data, uint32_t id, int res, const char *error);
}; };
/** Specify the name of the protocol to use, default is using the native protocol */ /** Specify the name of the protocol to use, default is using the native protocol */