/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_input.h>
#include <vlc_es_out.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
+#ifdef HAVE_POLL
+# include <poll.h>
+#endif
#include <vlc_network.h>
"the master client used for the network synchronisation." )
vlc_module_begin();
- set_shortname( _("Network Sync"));
- set_description( _("Network synchronisation") );
+ 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, VLC_TRUE );
+ NETSYNC_TEXT, NETSYNC_LONGTEXT, true );
add_string( "netsync-master-ip", NULL, NULL, MIP_TEXT, MIP_LONGTEXT,
- VLC_TRUE );
+ true );
set_capability( "interface", 0 );
set_callbacks( Activate, Close );
{
#define MAX_MSG_LENGTH (2 * sizeof(int64_t))
- vlc_bool_t b_master = config_GetInt( p_intf, "netsync-master" );
+ bool b_master = config_GetInt( p_intf, "netsync-master" );
char *psz_master = NULL;
char p_data[MAX_MSG_LENGTH];
int i_socket;
else
i_socket = net_ConnectUDP( VLC_OBJECT(p_intf), psz_master, NETSYNC_PORT, 0 );
- if( psz_master ) free( psz_master );
+ free( psz_master );
if( i_socket < 0 )
{
(struct sockaddr *)&from, i_struct_size );
#if 0
- msg_Dbg( p_intf, "Master clockref: "I64Fd" -> "I64Fd", from %s "
- "(date: "I64Fd")", i_clockref, i_master_clockref,
+ msg_Dbg( p_intf, "Master clockref: %"PRId64" -> %"PRId64", from %s "
+ "(date: %"PRId64")", i_clockref, i_master_clockref,
from.ss_family == AF_INET
? inet_ntoa(((struct sockaddr_in *)&from)->sin_addr)
: "non-IPv4", i_date );
}
#if 0
- msg_Dbg( p_intf, "Slave clockref: "I64Fd" -> "I64Fd" -> "I64Fd", "
- "clock diff: "I64Fd" drift: "I64Fd,
+ msg_Dbg( p_intf, "Slave clockref: %"PRId64" -> %"PRId64" -> %"PRId64", "
+ "clock diff: %"PRId64" drift: %"PRId64,
i_clockref, i_master_clockref,
i_client_clockref, i_diff_date, i_drift );
#endif