[vlc-devel] commit: hotkeys: factorization. ( Rémi Duraffort )

git version control git at videolan.org
Fri Feb 27 19:24:47 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Feb 27 17:18:55 2009 +0100| [8285136ce30f68018d850dbc509b4a7141dc0183] | committer: Rémi Duraffort 

hotkeys: factorization.

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

 modules/control/hotkeys.c |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 473536d..4ed3ee5 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -163,7 +163,6 @@ static void Run( intf_thread_t *p_intf )
 {
     vout_thread_t *p_vout = NULL;
     vlc_value_t val;
-    int i;
     playlist_t *p_playlist = pl_Hold( p_intf );
     int canc = vlc_savecancel();
 
@@ -198,6 +197,7 @@ static void Run( intf_thread_t *p_intf )
         /* Register OSD channels */
         if( p_vout && p_vout != p_last_vout )
         {
+            int i;
             for( i = 0; i < CHANNELS_NUMBER; i++ )
             {
                 spu_Control( p_vout->p_spu, SPU_CHANNEL_REGISTER,
@@ -502,22 +502,13 @@ static void Run( intf_thread_t *p_intf )
                 {
                     msg_Warn( p_input,
                               "invalid current audio track, selecting 0" );
-                    var_Set( p_input, "audio-es",
-                             list.p_list->p_values[0] );
                     i = 0;
                 }
                 else if( i == i_count - 1 )
-                {
-                    var_Set( p_input, "audio-es",
-                             list.p_list->p_values[1] );
                     i = 1;
-                }
                 else
-                {
-                    var_Set( p_input, "audio-es",
-                             list.p_list->p_values[i+1] );
                     i++;
-                }
+                var_Set( p_input, "audio-es", list.p_list->p_values[i] );
                 vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
                                  _("Audio track: %s"),
                                  list2.p_list->p_values[i].psz_string );
@@ -549,19 +540,13 @@ static void Run( intf_thread_t *p_intf )
                 {
                     msg_Warn( p_input,
                               "invalid current subtitle track, selecting 0" );
-                    var_Set( p_input, "spu-es", list.p_list->p_values[0] );
                     i = 0;
                 }
                 else if( i == i_count - 1 )
-                {
-                    var_Set( p_input, "spu-es", list.p_list->p_values[0] );
                     i = 0;
-                }
                 else
-                {
-                    var_Set( p_input, "spu-es", list.p_list->p_values[i+1] );
-                    i = i + 1;
-                }
+                    i++;
+                var_Set( p_input, "spu-es", list.p_list->p_values[i] );
                 vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
                                  _("Subtitle track: %s"),
                                  list2.p_list->p_values[i].psz_string );




More information about the vlc-devel mailing list