client-node: improve error reporting

Separate read failure and missed wakeup in 2 messages.
This commit is contained in:
Wim Taymans 2020-05-01 11:19:34 +02:00
parent e83bf8a33f
commit 940ff7f53b

View file

@ -1083,9 +1083,11 @@ static void node_on_data_fd_events(struct spa_source *source)
if (source->rmask & SPA_IO_IN) { if (source->rmask & SPA_IO_IN) {
uint64_t cmd; uint64_t cmd;
if (spa_system_eventfd_read(this->data_system, if (SPA_UNLIKELY(spa_system_eventfd_read(this->data_system,
this->data_source.fd, &cmd) < 0 || cmd != 1) this->data_source.fd, &cmd) < 0))
spa_log_warn(this->log, NAME" %p: read %"PRIu64" failed %m", this, cmd); pw_log_warn(NAME" %p: read failed %m", this);
if (SPA_UNLIKELY(cmd > 1))
pw_log_warn(NAME" %p: missed %"PRIu64" wakeups", this, cmd - 1);
spa_log_trace_fp(this->log, NAME" %p: got ready", this); spa_log_trace_fp(this->log, NAME" %p: got ready", this);
spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA); spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA);