protocol-native: disconnect remote

Disconnect the node and all the streams instead of just changing the
state.
This commit is contained in:
Wim Taymans 2018-02-26 12:26:12 +01:00
parent 6f61ac9357
commit e2f01c5838

View file

@ -502,16 +502,10 @@ on_remote_data(void *data, int fd, enum spa_io mask)
struct pw_core *core = pw_remote_get_core(this); struct pw_core *core = pw_remote_get_core(this);
if (mask & (SPA_IO_ERR | SPA_IO_HUP)) { if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
enum pw_remote_state state;
pw_log_error("protocol-native %p: got connection error", impl); pw_log_error("protocol-native %p: got connection error", impl);
pw_loop_destroy_source(pw_core_get_main_loop(core), impl->source); pw_loop_destroy_source(pw_core_get_main_loop(core), impl->source);
impl->source = NULL; impl->source = NULL;
if (mask & SPA_IO_HUP) pw_remote_disconnect(this);
state = PW_REMOTE_STATE_UNCONNECTED;
else
state = PW_REMOTE_STATE_ERROR;
pw_remote_update_state(this, state, "connection error");
return; return;
} }