[vlc-commits] Win32: use vlc_GetActionId

Rémi Denis-Courmont git at videolan.org
Sat Feb 12 22:57:38 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 12 23:54:29 2011 +0200| [874ed84035e29d07c9a5ab1d14f79d46a91b67d3] | committer: Rémi Denis-Courmont

Win32: use vlc_GetActionId

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

 modules/control/globalhotkeys/win32.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/control/globalhotkeys/win32.c b/modules/control/globalhotkeys/win32.c
index 8e3aeaf..f3d78cb 100644
--- a/modules/control/globalhotkeys/win32.c
+++ b/modules/control/globalhotkeys/win32.c
@@ -296,21 +296,17 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
 
                 LONG_PTR ret = GetWindowLongPtr( hwnd, GWLP_USERDATA );
                 intf_thread_t *p_intf = (intf_thread_t*)ret;
-                const struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
 
                 if( !GlobalGetAtomNameA(
                         wParam, psz_atomName, sizeof( psz_atomName ) ) )
                     return 0;
 
                 /* search for key associated with VLC */
-                for( int i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+                vlc_key_t action = vlc_GetActionId( psz_atomName );
+                if( action != ACTIONID_NONE )
                 {
-                    if( strcmp( p_hotkeys[i].psz_action, psz_atomName ) )
-                        continue;
-
                     var_SetInteger( p_intf->p_libvlc,
-                            "key-action", p_hotkeys[i].i_action );
-
+                            "key-action", action );
                     return 1;
                 }
             }



More information about the vlc-commits mailing list