Commit f5187553 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture_pool: do not fail if pictures are available immediately

This avoids spurious errors in the decoders (and logs).
parent 4b0d2358
...@@ -244,14 +244,15 @@ picture_t *picture_pool_Wait(picture_pool_t *pool) ...@@ -244,14 +244,15 @@ picture_t *picture_pool_Wait(picture_pool_t *pool)
vlc_mutex_lock(&pool->lock); vlc_mutex_lock(&pool->lock);
assert(pool->refs > 0); assert(pool->refs > 0);
while (pool->available == 0 && !pool->canceled) while (pool->available == 0)
vlc_cond_wait(&pool->wait, &pool->lock); {
if (pool->canceled) if (pool->canceled)
{ {
vlc_mutex_unlock(&pool->lock); vlc_mutex_unlock(&pool->lock);
return NULL; return NULL;
} }
vlc_cond_wait(&pool->wait, &pool->lock);
}
i = ffsll(pool->available); i = ffsll(pool->available);
assert(i > 0); assert(i > 0);
......
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