[vlc-devel] [PATCH 5/5] picture_pool: do not fail if pictures are available immediately
Thomas Guillem
thomas at gllm.fr
Mon Nov 30 19:15:18 CET 2015
On Mon, Nov 30, 2015, at 18:02, Rémi Denis-Courmont wrote:
> This avoids spurious errors in the decoders (and logs).
> ---
> src/misc/picture_pool.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
> index ececf19..364dfdc 100644
> --- a/src/misc/picture_pool.c
> +++ b/src/misc/picture_pool.c
> @@ -244,13 +244,14 @@ picture_t *picture_pool_Wait(picture_pool_t *pool)
> vlc_mutex_lock(&pool->lock);
> assert(pool->refs > 0);
>
> - while (pool->available == 0 && !pool->canceled)
> - vlc_cond_wait(&pool->wait, &pool->lock);
> -
> - if (pool->canceled)
> + while (pool->available == 0)
> {
> - vlc_mutex_unlock(&pool->lock);
> - return NULL;
> + if (pool->canceled)
> + {
> + vlc_mutex_unlock(&pool->lock);
> + return NULL;
> + }
> + vlc_cond_wait(&pool->wait, &pool->lock);
> }
>
Indeed, I forgot to handle available != 0 && pool-canceled.
> i = ffsll(pool->available);
> --
> 2.6.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list