[vlc-commits] input: treat negative deadline as no deadline in ControlPop()

Rémi Denis-Courmont git at videolan.org
Sat Feb 21 19:42:15 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 21 16:57:32 2015 +0200| [2f4d59645b630bc8386b493042b1d071357e3b35] | committer: Rémi Denis-Courmont

input: treat negative deadline as no deadline in ControlPop()

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

 src/input/input.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 0ff8f67..36d3b6d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1482,12 +1482,17 @@ static inline int ControlPop( input_thread_t *p_input,
             return VLC_EGENERIC;
         }
 
-        if( vlc_cond_timedwait( &p_sys->wait_control, &p_sys->lock_control,
-                                i_deadline ) )
+        if( i_deadline >= 0 )
         {
-            vlc_mutex_unlock( &p_sys->lock_control );
-            return VLC_EGENERIC;
+            if( vlc_cond_timedwait( &p_sys->wait_control, &p_sys->lock_control,
+                                    i_deadline ) )
+            {
+                vlc_mutex_unlock( &p_sys->lock_control );
+                return VLC_EGENERIC;
+            }
         }
+        else
+            vlc_cond_wait( &p_sys->wait_control, &p_sys->lock_control );
     }
 
     /* */



More information about the vlc-commits mailing list