audioconvert: only dequeue a buffer when queued

Add an extra check to only dequeue a buffer when it's queued. This
should always be the case but let's check again to be safe.

See #3384
This commit is contained in:
Wim Taymans 2023-08-01 15:04:31 +02:00
parent 950c2d2675
commit 35d932bc8b

View file

@ -2331,10 +2331,12 @@ static inline struct buffer *peek_buffer(struct impl *this, struct port *port)
static inline void dequeue_buffer(struct impl *this, struct port *port, struct buffer *b)
{
spa_list_remove(&b->link);
SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED);
spa_log_trace_fp(this->log, "%p: dequeue buffer %d on port %d %u",
this, b->id, port->id, b->flags);
if (!SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_QUEUED))
return;
spa_list_remove(&b->link);
SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED);
}
static int