]> git.sesse.net Git - vlc/blobdiff - modules/control/netsync.c
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / control / netsync.c
index 63fb8f40baff81607a12f3dfaa67a6d1ff34ef67..2f9e778f13e878c0c1a60747a04ac2625e9be7ca 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * netsync.c: synchronisation between several network clients.
+ * netsync.c: synchronization between several network clients.
  *****************************************************************************
  * Copyright (C) 2004-2009 the VideoLAN team
  * $Id$
@@ -56,20 +56,20 @@ static void Close(vlc_object_t *);
 
 #define NETSYNC_TEXT N_("Network master clock")
 #define NETSYNC_LONGTEXT N_("When set then " \
-  "this vlc instance shall dictate its clock for synchronisation" \
+  "This VLC instance shall dictate its clock for synchronization " \
   "over clients listening on the masters network ip address")
 
 #define MIP_TEXT N_("Master server ip address")
 #define MIP_LONGTEXT N_("The IP address of " \
-  "the network master clock to use for clock synchronisation.")
+  "The network master clock to use for clock synchronization.")
 
 #define NETSYNC_TIMEOUT_TEXT N_("UDP timeout (in ms)")
-#define NETSYNC_TIMEOUT_LONGTEXT N_("Amount of time (in ms) " \
-  "to wait before aborting network reception of data.")
+#define NETSYNC_TIMEOUT_LONGTEXT N_("Length of time (in ms) " \
+  "until aborting data reception.")
 
 vlc_module_begin()
     set_shortname(N_("Network Sync"))
-    set_description(N_("Network synchronisation"))
+    set_description(N_("Network synchronization"))
     set_category(CAT_ADVANCED)
     set_subcategory(SUBCAT_ADVANCED_MISC)
 
@@ -139,7 +139,7 @@ static int Open(vlc_object_t *object)
     sys->timeout = var_InheritInteger(intf, "netsync-timeout");
     if (sys->timeout < 500)
         sys->timeout = 500;
-    sys->playlist = pl_Hold(intf);
+    sys->playlist = pl_Get(intf);
     sys->input = NULL;
 
     var_AddCallback(sys->playlist, "input-current", PlaylistEvent, intf);
@@ -156,7 +156,6 @@ void Close(vlc_object_t *object)
 
     assert(sys->input == NULL);
     var_DelCallback(sys->playlist, "input-current", PlaylistEvent, intf);
-    pl_Release(intf);
     net_Close(sys->fd);
     free(sys);
 }
@@ -164,8 +163,9 @@ void Close(vlc_object_t *object)
 static mtime_t GetPcrSystem(input_thread_t *input)
 {
     int canc = vlc_savecancel();
+    /* TODO use the delay */
     mtime_t system;
-    if (input_GetPcrSystem(input, &system))
+    if (input_GetPcrSystem(input, &system, NULL))
         system = -1;
     vlc_restorecancel(canc);
 
@@ -251,7 +251,7 @@ static void *Slave(void *handle)
             int canc = vlc_savecancel();
 
             mtime_t client_system;
-            if (!input_GetPcrSystem(sys->input, &client_system)) {
+            if (!input_GetPcrSystem(sys->input, &client_system, NULL)) {
                 const mtime_t diff_system = client_system - master_system - diff_date;
                 if (diff_system != 0) {
                     input_ModifyPcrSystem(sys->input, true, master_system - diff_date);