]> git.sesse.net Git - vlc/blobdiff - modules/control/hotkeys.c
control/*: fix warnings
[vlc] / modules / control / hotkeys.c
index 87cdda4f42f1da829b5353e10f48965e93a3c475..aa0255a534ff789dbc355ff4532ab34ece5c4f5a 100644 (file)
  * Preamble
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_interface.h>
 #include <vlc_input.h>
@@ -154,7 +158,7 @@ static void Run( intf_thread_t *p_intf )
         var_Set( p_intf->p_libvlc, p_hotkeys[i].psz_action, val );
     }
 
-    while( !intf_ShouldDie( p_intf ) )
+    for( vlc_bool_t b_quit = VLC_FALSE ; !b_quit; )
     {
         int i_key, i_action;
         int i_times = 0;
@@ -204,11 +208,8 @@ static void Run( intf_thread_t *p_intf )
 
         if( !i_action )
         {
-            vlc_mutex_lock( &p_intf->object_lock );
-            vlc_cond_wait( &p_intf->object_wait, &p_intf->object_lock );
-            vlc_mutex_unlock( &p_intf->object_lock );
+            b_quit = vlc_object_lock_and_wait( p_intf );
             /* No key pressed, sleep a bit more */
-//            msleep( INTF_IDLE_SLEEP );
             continue;
         }
 
@@ -827,6 +828,7 @@ static int GetKey( intf_thread_t *p_intf)
 static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
                      vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
+    VLC_UNUSED(psz_var); VLC_UNUSED(oldval);
     intf_thread_t *p_intf = (intf_thread_t *)p_data;
     if ( !newval.i_int )
     {
@@ -856,6 +858,7 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
 static int ActionKeyCB( vlc_object_t *p_this, char const *psz_var,
                         vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
     libvlc_int_t *p_libvlc = (libvlc_int_t *)p_this;
     struct hotkey *p_hotkeys = p_libvlc->p_hotkeys;
     mtime_t i_date;