Commit 5505394d authored by Laurent Aimar's avatar Laurent Aimar

Fixed a huge regression in block_FifoPut.

It was broken as soon as a linked list of buffers was pushed.
parent dec529e1
......@@ -571,18 +571,21 @@ void block_FifoPace (block_fifo_t *fifo, size_t max_depth, size_t max_size)
size_t block_FifoPut( block_fifo_t *p_fifo, block_t *p_block )
{
size_t i_size = 0, i_depth = 0;
block_t *p_last;
if (p_block == NULL)
return 0;
for (block_t *b = p_block; b != NULL; b = b->p_next)
for (p_last = p_block; ; p_last = p_last->p_next)
{
i_size += b->i_buffer;
i_size += p_last->i_buffer;
i_depth++;
if (!p_last->p_next)
break;
}
vlc_mutex_lock (&p_fifo->lock);
*p_fifo->pp_last = p_block;
p_fifo->pp_last = &p_block->p_next;
p_fifo->pp_last = &p_last->p_next;
p_fifo->i_depth += i_depth;
p_fifo->i_size += i_size;
/* We queued at least one block: wake up one read-waiting thread */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment