spa: warn out of buffers

Running out of buffers is pretty bad and warrants a warning because it
can cause loss of audio.

See #3316
This commit is contained in:
Wim Taymans 2023-07-07 12:11:02 +02:00
parent 21d16b1ad5
commit baa5497617
4 changed files with 12 additions and 6 deletions

View file

@ -2298,8 +2298,9 @@ static inline struct buffer *peek_buffer(struct impl *this, struct port *port)
struct buffer *b;
if (spa_list_is_empty(&port->queue)) {
spa_log_trace_fp(this->log, "%p: out of buffers on port %d %d",
this, port->id, port->n_buffers);
if (port->n_buffers > 0)
spa_log_warn(this->log, "%p: out of buffers on port %d %d",
this, port->id, port->n_buffers);
return NULL;
}

View file

@ -786,8 +786,9 @@ static int impl_node_process(void *object)
outb = dequeue_buffer(this, outport);
if (SPA_UNLIKELY(outb == NULL)) {
spa_log_trace(this->log, "%p: out of buffers (%d)", this,
outport->n_buffers);
if (outport->n_buffers > 0)
spa_log_warn(this->log, "%p: out of buffers (%d)", this,
outport->n_buffers);
return -EPIPE;
}

View file

@ -722,7 +722,9 @@ static int impl_node_process(void *object)
outb = dequeue_buffer(this, outport);
if (SPA_UNLIKELY(outb == NULL)) {
spa_log_trace(this->log, "%p: out of buffers", this);
if (outport->n_buffers > 0)
spa_log_warn(this->log, "%p: out of buffers (%d)", this,
outport->n_buffers);
return -EPIPE;
}

View file

@ -623,7 +623,9 @@ static int impl_node_process(void *object)
/* get output buffer */
if ((outb = dequeue_buffer(this, outport)) == NULL) {
spa_log_trace(this->log, NAME " %p: out of buffers", this);
if (outport->n_buffers > 0)
spa_log_warn(this->log, NAME " %p: out of buffers (%d)",
this, outport->n_buffers);
return -EPIPE;
}