alsa-seq: warn when receive fails

This can happen when allocation fails or the message is too long.
This commit is contained in:
Wim Taymans 2024-05-13 15:17:21 +02:00
parent cdc150a2c3
commit ea0ba1162e

View file

@ -503,7 +503,7 @@ static int process_read(struct seq_state *state)
int res;
/* copy all new midi events into their port buffers */
while (snd_seq_event_input(state->event.hndl, &ev) > 0) {
while ((res = snd_seq_event_input(state->event.hndl, &ev)) > 0) {
const snd_seq_addr_t *addr = &ev->source;
struct seq_port *port;
uint64_t ev_time, diff;
@ -561,6 +561,8 @@ static int process_read(struct seq_state *state)
MAX_EVENT_SIZE > port->buffer->buf->datas[0].maxsize)
break;
}
if (res < 0 && res != -EAGAIN)
spa_log_warn(state->log, "event read failed: %s", snd_strerror(res));
/* prepare a buffer on each port, some ports might have their
* buffer filled above */