From 82513bf14275dd518c1fd9391fb5acfe2b3512ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
Date: Sun, 27 Sep 2015 23:04:36 +0300
Subject: [PATCH] goom: simplify use of vout_GetPicture()

---
 modules/visualization/goom.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index 1fa1878ecf56..d499d84721e1 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -327,17 +327,9 @@ static void *Thread( void *p_thread_data )
         plane = goom_update( p_plugin_info, p_data, 0, 0.0,
                              NULL, NULL );
 
-        while( !( p_pic = vout_GetPicture( p_thread->p_vout ) ) )
-        {
-            vlc_mutex_lock( &p_thread->lock );
-            bool b_exit = p_thread->b_exit;
-            vlc_mutex_unlock( &p_thread->lock );
-            if( b_exit )
-                break;
-            msleep( VOUT_OUTMEM_SLEEP );
-        }
-
-        if( p_pic == NULL ) break;
+        p_pic = vout_GetPicture( p_thread->p_vout );
+        if( unlikely(p_pic == NULL) )
+            continue;
 
         memcpy( p_pic->p[0].p_pixels, plane, p_thread->i_width * p_thread->i_height * 4 );
 
-- 
GitLab