]> git.sesse.net Git - vlc/blobdiff - modules/control/gestures.c
Trailing ;
[vlc] / modules / control / gestures.c
index d0bb0291328b25332c1df3f6236b7a899c8697df..7ff1a465a66b679bb859bee5c0a2edd7a5f45696 100644 (file)
@@ -91,20 +91,20 @@ static const char *const button_list[] = { "left", "middle", "right" };
 static const char *const button_list_text[] =
                                    { N_("Left"), N_("Middle"), N_("Right") };
 
-vlc_module_begin();
-    set_shortname( N_("Gestures"));
-    set_category( CAT_INTERFACE );
-    set_subcategory( SUBCAT_INTERFACE_CONTROL );
+vlc_module_begin ()
+    set_shortname( N_("Gestures"))
+    set_category( CAT_INTERFACE )
+    set_subcategory( SUBCAT_INTERFACE_CONTROL )
     add_integer( "gestures-threshold", 30, NULL,
-                 THRESHOLD_TEXT, THRESHOLD_LONGTEXT, true );
+                 THRESHOLD_TEXT, THRESHOLD_LONGTEXT, true )
     add_string( "gestures-button", "right", NULL,
-                BUTTON_TEXT, BUTTON_LONGTEXT, false );
+                BUTTON_TEXT, BUTTON_LONGTEXT, false )
         change_string_list( button_list, button_list_text, 0 );
-    set_description( N_("Mouse gestures control interface") );
+    set_description( N_("Mouse gestures control interface") )
 
-    set_capability( "interface", 0 );
-    set_callbacks( Open, Close );
-vlc_module_end();
+    set_capability( "interface", 0 )
+    set_callbacks( Open, Close )
+vlc_module_end ()
 
 /*****************************************************************************
  * OpenIntf: initialize interface
@@ -139,15 +139,7 @@ static int gesture( int i_pattern, int i_num )
  *****************************************************************************/
 static input_thread_t * input_from_playlist ( playlist_t *p_playlist )
 {
-    input_thread_t * p_input;
-
-    PL_LOCK;
-    p_input = p_playlist->p_input;
-    if( p_input )
-        vlc_object_yield( p_input );
-    PL_UNLOCK;
-
-    return p_input;
+    return playlist_CurrentInput( p_playlist );
 }
 
 /*****************************************************************************
@@ -227,7 +219,7 @@ static void RunIntf( intf_thread_t *p_intf )
             case GESTURE(RIGHT,LEFT,NONE,NONE):
                 {
                     input_thread_t * p_input;
-                    p_playlist = pl_Yield( p_intf );
+                    p_playlist = pl_Hold( p_intf );
 
                     p_input = input_from_playlist( p_playlist );
                     vlc_object_release( p_playlist );
@@ -254,13 +246,13 @@ static void RunIntf( intf_thread_t *p_intf )
                 }
                 break;
             case GESTURE(LEFT,DOWN,NONE,NONE):
-                p_playlist = pl_Yield( p_intf );
+                p_playlist = pl_Hold( p_intf );
 
                 playlist_Prev( p_playlist );
                 vlc_object_release( p_playlist );
                 break;
             case GESTURE(RIGHT,DOWN,NONE,NONE):
-                p_playlist = pl_Yield( p_intf );
+                p_playlist = pl_Hold( p_intf );
 
                 playlist_Next( p_playlist );
                 vlc_object_release( p_playlist );
@@ -293,7 +285,7 @@ static void RunIntf( intf_thread_t *p_intf )
                    vlc_value_t val, list, list2;
                    int i_count, i;
 
-                    p_playlist = pl_Yield( p_intf );
+                    p_playlist = pl_Hold( p_intf );
 
                     p_input = input_from_playlist( p_playlist );
 
@@ -348,7 +340,7 @@ static void RunIntf( intf_thread_t *p_intf )
                     vlc_value_t val, list, list2;
                     int i_count, i;
 
-                    p_playlist = pl_Yield( p_intf );
+                    p_playlist = pl_Hold( p_intf );
 
                     p_input = input_from_playlist( p_playlist );
                     vlc_object_release( p_playlist );
@@ -404,7 +396,7 @@ static void RunIntf( intf_thread_t *p_intf )
                 break;
             case GESTURE(DOWN,LEFT,NONE,NONE):
                 /* FIXME: Should close the vout!"*/
-                vlc_object_kill( p_intf->p_libvlc );
+                libvlc_Quit( p_intf->p_libvlc );
                 break;
             case GESTURE(DOWN,LEFT,UP,RIGHT):
             case GESTURE(UP,RIGHT,DOWN,LEFT):