]> git.sesse.net Git - vlc/commitdiff
Simplify up/down subtitle hotkey.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 28 May 2010 19:50:18 +0000 (21:50 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 29 May 2010 20:12:31 +0000 (22:12 +0200)
modules/control/hotkeys.c

index b1444d7baec0a1b40740cec01450a2f31bb278a5..31e1895a15397c220c04a53aca7403a4ffaaf852 100644 (file)
@@ -783,21 +783,15 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
                                 _( "Subtitle delay %i ms" ),
                                  (int)(i_delay/1000) );
             }
-            else if( i_action == ACTIONID_SUBPOS_DOWN )
+            else if( i_action == ACTIONID_SUBPOS_DOWN ||
+                     i_action == ACTIONID_SUBPOS_UP )
             {
-                int i_pos = var_GetInteger( p_input, "sub-margin" );
-                --i_pos;
-                var_SetInteger( p_input, "sub-margin", i_pos );
-                ClearChannels( p_intf, p_vout );
-                DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
-                                _( "Subtitle position %i px" ),
-                                 (int)(i_pos) );
-            }
-            else if( i_action == ACTIONID_SUBPOS_UP )
-            {
-                int i_pos = var_GetInteger( p_input, "sub-margin" );
-                ++i_pos;
-                var_SetInteger( p_input, "sub-margin", i_pos );
+                int i_pos;
+                if( i_action == ACTIONID_SUBPOS_DOWN )
+                    i_pos = var_DecInteger( p_input, "sub-margin" );
+                else
+                    i_pos = var_IncInteger( p_input, "sub-margin" );
+
                 ClearChannels( p_intf, p_vout );
                 DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
                                 _( "Subtitle position %i px" ),