[vlc-commits] picture_pool: do not fail if pictures are available immediately

Rémi Denis-Courmont git at videolan.org
Mon Nov 30 19:17:26 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 30 19:01:16 2015 +0200| [f5187553c6405d1f867db63d8e4dff9bc3142443] | committer: Rémi Denis-Courmont

picture_pool: do not fail if pictures are available immediately

This avoids spurious errors in the decoders (and logs).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5187553c6405d1f867db63d8e4dff9bc3142443
---

 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);
     }
 
     i = ffsll(pool->available);



More information about the vlc-commits mailing list