/*****************************************************************************
- * netsync.c: synchronisation between several network clients.
+ * netsync.c: synchronization between several network clients.
*****************************************************************************
* Copyright (C) 2004-2009 the VideoLAN team
* $Id$
#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)
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);
assert(sys->input == NULL);
var_DelCallback(sys->playlist, "input-current", PlaylistEvent, intf);
- pl_Release(intf);
net_Close(sys->fd);
free(sys);
}
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);
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);