[vlc-devel] [PATCH 3/5] netsync: use autorun to start
remi at remlab.net
remi at remlab.net
Fri Nov 20 19:09:50 CET 2020
From: RĂ©mi Denis-Courmont <remi at remlab.net>
---
modules/control/netsync.c | 10 ++++++++++
src/libvlc.c | 3 ---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/modules/control/netsync.c b/modules/control/netsync.c
index 4a75bc5bbd..05003a0121 100644
--- a/modules/control/netsync.c
+++ b/modules/control/netsync.c
@@ -64,6 +64,12 @@ static void Close(vlc_object_t *);
#define NETSYNC_TIMEOUT_LONGTEXT N_("Length of time (in ms) " \
"until aborting data reception.")
+static void AutoRun(libvlc_int_t *libvlc)
+{
+ if (var_InheritBool(libvlc, "network-synchronisation"))
+ intf_Create(libvlc, MODULE_STRING);
+}
+
vlc_module_begin()
set_shortname(N_("Network Sync"))
set_description(N_("Network synchronization"))
@@ -79,6 +85,10 @@ vlc_module_begin()
set_capability("interface", 0)
set_callbacks(Open, Close)
+
+ add_submodule()
+ set_capability("autorun", 40)
+ set_callback(AutoRun)
vlc_module_end()
/*****************************************************************************
diff --git a/src/libvlc.c b/src/libvlc.c
index c1dcde276d..8346773c8d 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -279,9 +279,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
libvlc_AddInterfaces(p_libvlc, "extraintf");
libvlc_AddInterfaces(p_libvlc, "control");
- if( var_InheritBool( p_libvlc, "network-synchronisation") )
- libvlc_InternalAddIntf( p_libvlc, "netsync,none" );
-
#ifdef __APPLE__
var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
--
2.29.2
More information about the vlc-devel
mailing list