[vlc-devel] [PATCH 2/5] hotkeys: use autorun to start
remi at remlab.net
remi at remlab.net
Fri Nov 20 19:09:49 CET 2020
From: RĂ©mi Denis-Courmont <remi at remlab.net>
---
bin/darwinvlc.m | 2 --
bin/vlc.c | 1 -
bin/winvlc.c | 1 -
modules/control/hotkeys.c | 9 +++++++++
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/bin/darwinvlc.m b/bin/darwinvlc.m
index b405c9731f..8a7124104f 100644
--- a/bin/darwinvlc.m
+++ b/bin/darwinvlc.m
@@ -273,8 +273,6 @@ int main(int i_argc, const char *ppsz_argv[])
libvlc_set_app_id(vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
libvlc_set_user_agent(vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
- libvlc_add_intf(vlc, "hotkeys,none");
-
if (libvlc_add_intf(vlc, NULL)) {
fprintf(stderr, "VLC cannot start any interface. Exiting.\n");
goto out;
diff --git a/bin/vlc.c b/bin/vlc.c
index 268922a617..4134ee5bb0 100644
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -235,7 +235,6 @@ int main(int argc, const char *argv[])
libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
- libvlc_add_intf (vlc, "hotkeys,none");
#if !defined (__OS2__)
libvlc_add_intf (vlc, "globalhotkeys,none");
#endif
diff --git a/bin/winvlc.c b/bin/winvlc.c
index 81fed36205..92707af5b5 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -257,7 +257,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION,
PACKAGE_NAME);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
- libvlc_add_intf (vlc, "hotkeys,none");
libvlc_add_intf (vlc, "globalhotkeys,none");
libvlc_add_intf (vlc, NULL);
libvlc_playlist_play (vlc);
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index f03c864e2e..7f554ff301 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -1268,6 +1268,11 @@ Close(vlc_object_t *this)
free(sys);
}
+static void AutoRun(libvlc_int_t *libvlc)
+{
+ intf_Create(libvlc, MODULE_STRING);
+}
+
vlc_module_begin ()
set_shortname(N_("Hotkeys"))
set_description(N_("Hotkeys management interface"))
@@ -1275,4 +1280,8 @@ vlc_module_begin ()
set_callbacks(Open, Close)
set_category(CAT_INTERFACE)
set_subcategory(SUBCAT_INTERFACE_HOTKEYS)
+
+ add_submodule()
+ set_capability("autorun", 20)
+ set_callback(AutoRun)
vlc_module_end ()
--
2.29.2
More information about the vlc-devel
mailing list