]> git.sesse.net Git - vlc/blobdiff - modules/control/netsync.c
QT4: leave assert there
[vlc] / modules / control / netsync.c
index 3b4b7bc3df53a14f3c66cab5360df6cd32598675..118255e3c71f2dcf8a14af876aff4fc04bd04c1d 100644 (file)
 #ifdef HAVE_UNISTD_H
 #    include <unistd.h>
 #endif
-#ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#   include <sys/types.h>
-#endif
+#include <sys/types.h>
 #ifdef HAVE_POLL
 #   include <poll.h>
 #endif
@@ -72,20 +67,20 @@ static mtime_t GetClockRef( intf_thread_t *, mtime_t );
 #define MIP_LONGTEXT N_( "IP address of " \
   "the master client used for the network synchronisation." )
 
-vlc_module_begin();
-    set_shortname( N_("Network Sync"));
-    set_description( N_("Network synchronisation") );
-    set_category( CAT_ADVANCED );
-    set_subcategory( SUBCAT_ADVANCED_MISC );
+vlc_module_begin ()
+    set_shortname( N_("Network Sync"))
+    set_description( N_("Network synchronisation") )
+    set_category( CAT_ADVANCED )
+    set_subcategory( SUBCAT_ADVANCED_MISC )
 
-    add_bool( "netsync-master", 0, NULL,
-              NETSYNC_TEXT, NETSYNC_LONGTEXT, true );
+    add_bool( "netsync-master", false, NULL,
+              NETSYNC_TEXT, NETSYNC_LONGTEXT, true )
     add_string( "netsync-master-ip", NULL, NULL, MIP_TEXT, MIP_LONGTEXT,
-                true );
+                true )
 
-    set_capability( "interface", 0 );
-    set_callbacks( Activate, Close );
-vlc_module_end();
+    set_capability( "interface", 0 )
+    set_callbacks( Activate, Close )
+vlc_module_end ()
 
 /*****************************************************************************
  * Local prototypes
@@ -100,9 +95,9 @@ static int Activate( vlc_object_t *p_this )
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
     int fd;
 
-    if( config_GetInt( p_intf, "netsync-master" ) <= 0 )
+    if( !var_InheritInteger( p_intf, "netsync-master" ) )
     {
-        char *psz_master = config_GetPsz( p_intf, "netsync-master-ip" );
+        char *psz_master = var_InheritString( p_intf, "netsync-master-ip" );
         if( psz_master == NULL )
         {
             msg_Err( p_intf, "master address not specified" );