bluez5: guard against processing when errored or not started

Add some guards against doing processing when there has been an error or
the node is not started. Set error status to IO.  Continue driving on IO
errors.
This commit is contained in:
Pauli Virtanen 2023-03-10 18:57:12 +02:00 committed by Wim Taymans
parent 8fff69353b
commit 1664df2c85
4 changed files with 50 additions and 29 deletions

View file

@ -1444,8 +1444,14 @@ static int produce_buffer(struct impl *this)
io->buffer_id = SPA_ID_INVALID;
}
if (!this->source.loop) {
io->status = -EIO;
return SPA_STATUS_STOPPED;
}
/* Handle buffering */
process_buffering(this);
if (this->started)
process_buffering(this);
/* Return if there are no buffers ready to be processed */
if (spa_list_is_empty(&port->ready))