[vlc-commits] netsync: use autorun to start

Rémi Denis-Courmont git at videolan.org
Sun Nov 22 16:04:37 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 20 19:45:58 2020 +0200| [15626377ffaa4fbddc04245cc279f6b28fd491b8] | committer: Rémi Denis-Courmont

netsync: use autorun to start

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

 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 b4d0758325..2633f83741 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 );



More information about the vlc-commits mailing list