]> git.sesse.net Git - vlc/commitdiff
access_filter_dump: use key-action
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 26 Mar 2008 20:23:19 +0000 (22:23 +0200)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 27 Mar 2008 18:46:21 +0000 (20:46 +0200)
modules/access_filter/dump.c

index b0626c5e29af97ccd54a3a840f61f0602d040e41..24e656d9b5b968e552505e6518f331a4b450e1c6 100644 (file)
@@ -121,7 +121,7 @@ static int Open (vlc_object_t *obj)
     }
     p_sys->tmp_max = ((int64_t)var_CreateGetInteger (access, "dump-margin")) << 20;
 
-    var_AddCallback (access->p_libvlc, "key-pressed", KeyHandler, access);
+    var_AddCallback (access->p_libvlc, "key-action", KeyHandler, access);
 
     return VLC_SUCCESS;
 }
@@ -135,7 +135,7 @@ static void Close (vlc_object_t *obj)
     access_t *access = (access_t *)obj;
     access_sys_t *p_sys = access->p_sys;
 
-    var_DelCallback (access->p_libvlc, "key-pressed", KeyHandler, access);
+    var_DelCallback (access->p_libvlc, "key-action", KeyHandler, access);
 
     if (p_sys->stream != NULL)
         fclose (p_sys->stream);
@@ -327,16 +327,7 @@ static int KeyHandler (vlc_object_t *obj, char const *varname,
     (void)oldval;
     (void)obj;
 
-    for (struct hotkey *key = access->p_libvlc->p_hotkeys;
-         key->psz_action != NULL; key++)
-    {
-        if (key->i_key == newval.i_int)
-        {
-            if (key->i_action == ACTIONID_DUMP)
-                Trigger ((access_t *)data);
-            break;
-        }
-    }
-
+    if (newval.i_int == ACTIONID_DUMP)
+        Trigger (access);
     return VLC_SUCCESS;
 }