Commit cfa53f69 authored by Eric Petit's avatar Eric Petit

* ipv4.c, libvlc.h: add a --ttl option to set time-to-live when

                     multicasting with the stream output
 * modules/control/: missing cvsignore
parent d5fe6ade
.deps
.dirstamp
*.dll
*.dylib
*.sl
*.so
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ipv4.c: IPv4 network abstraction layer * ipv4.c: IPv4 network abstraction layer
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ipv4.c,v 1.13 2003/01/23 15:53:10 sam Exp $ * $Id: ipv4.c,v 1.14 2003/02/18 18:33:44 titer Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com> * Mathias Kretschmer <mathias@research.att.com>
...@@ -372,6 +372,35 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) ...@@ -372,6 +372,35 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
#endif #endif
return( -1 ); return( -1 );
} }
#ifndef WIN32
if( IN_MULTICAST( ntohl(sock.sin_addr.s_addr) ) )
#else
if( IN_MULTICAST( ntohl(inet_addr(psz_server_addr) ) ) )
#endif
{
/* set the time-to-live */
int ttl = config_GetInt( p_this, "ttl" );
if( ttl < 1 )
ttl = 1;
if( setsockopt( i_handle, IPPROTO_IP, IP_MULTICAST_TTL,
&ttl, sizeof( ttl ) ) < 0 )
{
#ifdef HAVE_ERRNO_H
msg_Warn( p_this, "failed to set ttl (%s)",
strerror(errno) );
#else
msg_Warn( p_this, "failed to set ttl" );
#endif
#if defined( WIN32 ) || defined( UNDER_CE )
closesocket( i_handle );
#else
close( i_handle );
#endif
return( -1 );
}
}
} }
p_socket->i_handle = i_handle; p_socket->i_handle = i_handle;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header * libvlc.h: main libvlc header
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.42 2003/02/09 01:13:43 massiot Exp $ * $Id: libvlc.h,v 1.43 2003/02/18 18:33:44 titer Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -224,6 +224,11 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL }; ...@@ -224,6 +224,11 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL };
"multicast solution, you will probably have to indicate the IP address " \ "multicast solution, you will probably have to indicate the IP address " \
"of your multicasting interface here.") "of your multicasting interface here.")
#define TTL_TEXT N_("time to live")
#define TTL_LONGTEXT N_( \
"Indicate here the Time To Live of the multicast packets sent by " \
"the stream output.")
#define INPUT_PROGRAM_TEXT N_("choose program (SID)") #define INPUT_PROGRAM_TEXT N_("choose program (SID)")
#define INPUT_PROGRAM_LONGTEXT N_( \ #define INPUT_PROGRAM_LONGTEXT N_( \
"Choose the program to select by giving its Service ID.") "Choose the program to select by giving its Service ID.")
...@@ -491,6 +496,7 @@ vlc_module_begin(); ...@@ -491,6 +496,7 @@ vlc_module_begin();
add_string( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT ); add_string( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT );
#endif #endif
add_string( "iface-addr", "", NULL, IFACE_ADDR_TEXT, IFACE_ADDR_LONGTEXT ); add_string( "iface-addr", "", NULL, IFACE_ADDR_TEXT, IFACE_ADDR_LONGTEXT );
add_integer( "ttl", 1, NULL, TTL_TEXT, TTL_LONGTEXT );
add_integer( "program", 0, NULL, add_integer( "program", 0, NULL,
INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT ); INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment