]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/dump.c
access: Rename access2 to access as access is no longer existing.
[vlc] / modules / access_filter / dump.c
index 214af4a55f7579459d8ef30877762e09150a9878..c22e447befda285f0d89cba15812a74fd2b7309a 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 
 #include <assert.h>
@@ -54,10 +58,10 @@ vlc_module_begin ();
     add_shortcut ("dump");
     set_callbacks (Open, Close);
 
-    add_bool ("dump-force", VLC_FALSE, NULL, FORCE_TEXT,
-              FORCE_LONGTEXT, VLC_FALSE);
+    add_bool ("dump-force", false, NULL, FORCE_TEXT,
+              FORCE_LONGTEXT, false);
     add_integer ("dump-margin", DEFAULT_MARGIN, NULL, MARGIN_TEXT,
-                 MARGIN_LONGTEXT, VLC_FALSE);
+                 MARGIN_LONGTEXT, false);
 vlc_module_end();
 
 static ssize_t Read (access_t *access, uint8_t *buffer, size_t len);
@@ -86,8 +90,8 @@ static int Open (vlc_object_t *obj)
 
     if (!var_CreateGetBool (access, "dump-force"))
     {
-        vlc_bool_t b;
-        if ((access2_Control (src, ACCESS_CAN_FASTSEEK, &b) == 0) && b)
+        bool b;
+        if ((access_Control (src, ACCESS_CAN_FASTSEEK, &b) == 0) && b)
         {
             msg_Dbg (obj, "dump filter useless");
             return VLC_EGENERIC;
@@ -117,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;
 }
@@ -131,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);
@@ -240,26 +244,6 @@ static int Seek (access_t *access, int64_t offset)
     return ret;
 }
 
-
-#ifndef HAVE_LOCALTIME_R
-static inline struct tm *localtime_r (const time_t *now, struct tm *res)
-{
-    struct tm *unsafe = localtime (now);
-    /*
-     * This is not thread-safe. Blame your C library.
-     * On Win32 there SHOULD be _localtime_s instead, but of course
-     * Cygwin and Mingw32 don't know about it. You're on your own if you
-     * use this platform.
-     */
-    if (unsafe == NULL)
-        return NULL;
-
-    memcpy (res, unsafe, sizeof (*res));
-    return res;
-}
-#endif
-
-
 static void Trigger (access_t *access)
 {
     access_sys_t *p_sys = access->p_sys;
@@ -343,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;
 }