[vlc-devel] commit: Add hotkey to cycle through audio devices (Dylan )

git version control git at videolan.org
Thu Mar 27 07:39:49 CET 2008


vlc | branch: master | Dylan <dyudaken at gmail.com> | Mon Mar 24 17:04:49 2008 +0200| [015ae8d010ef34de4876b17d0eb323534f1510be]

Add hotkey to cycle through audio devices

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/control/hotkeys.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index eb0f0ae..83428d0 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -516,7 +516,8 @@ static void Run( intf_thread_t *p_intf )
                 {
                     continue;
                 }
-                for( i = 1; i < i_count; i )
+ 
+                for( i = 0; i < i_count; i++ )
                 {
                     if( val.i_int == list.p_list->p_values[i].i_int )
                     {
@@ -528,29 +529,28 @@ static void Run( intf_thread_t *p_intf )
                     msg_Warn( p_aout,
                               "invalid current audio device, selecting 0" );
                     var_Set( p_aout, "audio-device",
-                             list.p_list->p_values[1] );
-                    i = 1;
+                             list.p_list->p_values[0] );
+                    i = 0;
            
                 }
                 else if( i == i_count -1 )
                 {
-                    var_Set( p_aout, "audio-device",
+                  var_Set( p_aout, "audio-device",
                              list.p_list->p_values[0] );
                     i = 0;
            
                 }
                 else
                 {
-                    var_Set( p_aout, "audio-device",
-                             list.p_list->p_values[i1] );
-                    i;
-        
+                  var_Set( p_aout, "audio-device",
+                             list.p_list->p_values[i+1] );                   
+                    i++;
                 }
                 vout_OSDMessage( VLC_OBJECT(p_input), 
                                  DEFAULT_CHAN,
                                  _("Audio Device: %s"),
-                                 list2.p_list->p_values[i].psz_string );
-       
+                                 list2.p_list->p_values[i].psz_string);
+                vlc_object_release( p_aout );        
             }
             else if( i_action == ACTIONID_SUBTITLE_TRACK )
             {
@@ -857,6 +857,7 @@ static void Run( intf_thread_t *p_intf )
             {
                 osd_MenuActivate( VLC_OBJECT(p_intf) );
             }
+
         }
         if( p_vout )
             vlc_object_release( p_vout );




More information about the vlc-devel mailing list