[vlc-devel] commit: Undo --sout-udp-auto-mcast ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed May 7 16:56:27 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May 7 17:31:23 2008 +0300| [8e65c917b65fd1d419853f42d9440de260c9a52d]
Undo --sout-udp-auto-mcast
(was not in previous release, so not adding _obsolete).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e65c917b65fd1d419853f42d9440de260c9a52d
---
modules/access_output/udp.c | 64 +++++-------------------------------------
1 files changed, 8 insertions(+), 56 deletions(-)
diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index 82960a2..b1f4e9f 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -74,9 +74,6 @@ static void Close( vlc_object_t * );
"of packets that will be sent at a time. It " \
"helps reducing the scheduling load on " \
"heavily-loaded systems." )
-#define AUTO_MCAST_TEXT N_("Automatic multicast streaming")
-#define AUTO_MCAST_LONGTEXT N_("Allocates an outbound multicast address " \
- "automatically.")
vlc_module_begin();
set_description( _("UDP stream output") );
@@ -88,8 +85,6 @@ vlc_module_begin();
true );
add_obsolete_integer( SOUT_CFG_PREFIX "late" );
add_obsolete_bool( SOUT_CFG_PREFIX "raw" );
- add_bool( SOUT_CFG_PREFIX "auto-mcast", false, NULL, AUTO_MCAST_TEXT,
- AUTO_MCAST_LONGTEXT, true );
set_capability( "sout access", 100 );
add_shortcut( "udp" );
@@ -101,7 +96,6 @@ vlc_module_end();
*****************************************************************************/
static const char *const ppsz_sout_options[] = {
- "auto-mcast",
"caching",
"group",
NULL
@@ -186,25 +180,16 @@ static int Open( vlc_object_t *p_this )
p_access->p_sys = p_sys;
i_dst_port = DEFAULT_PORT;
- if (var_GetBool (p_access, SOUT_CFG_PREFIX"auto-mcast"))
- {
- char buf[INET6_ADDRSTRLEN];
- if (MakeRandMulticast (AF_INET, buf, sizeof (buf)) != NULL)
- psz_dst_addr = strdup (buf);
- }
- else
- {
- char *psz_parser = psz_dst_addr = strdup( p_access->psz_path );
+ char *psz_parser = psz_dst_addr = strdup( p_access->psz_path );
- if (psz_parser[0] == '[')
- psz_parser = strchr (psz_parser, ']');
+ if (psz_parser[0] == '[')
+ psz_parser = strchr (psz_parser, ']');
- psz_parser = strchr (psz_parser ?: psz_dst_addr, ':');
- if (psz_parser != NULL)
- {
- *psz_parser++ = '\0';
- i_dst_port = atoi (psz_parser);
- }
+ psz_parser = strchr (psz_parser ?: psz_dst_addr, ':');
+ if (psz_parser != NULL)
+ {
+ *psz_parser++ = '\0';
+ i_dst_port = atoi (psz_parser);
}
p_sys->p_thread =
@@ -534,36 +519,3 @@ static void ThreadWrite( vlc_object_t *p_this )
i_date_last = i_date;
}
}
-
-
-static const char *MakeRandMulticast (int family, char *buf, size_t buflen)
-{
- uint32_t rand = (getpid() & 0xffff)
- | (uint32_t)(((mdate () >> 10) & 0xffff) << 16);
-
- switch (family)
- {
-#ifdef AF_INET6
- case AF_INET6:
- {
- struct in6_addr addr;
- memcpy (&addr, "\xff\x38\x00\x00" "\x00\x00\x00\x00"
- "\x00\x00\x00\x00", 12);
- rand |= 0x80000000;
- memcpy (addr.s6_addr + 12, &(uint32_t){ htonl (rand) }, 4);
- return inet_ntop (family, &addr, buf, buflen);
- }
-#endif
-
- case AF_INET:
- {
- struct in_addr addr;
- addr.s_addr = htonl ((rand & 0xffffff) | 0xe8000000);
- return inet_ntop (family, &addr, buf, buflen);
- }
- }
-#ifdef EAFNOSUPPORT
- errno = EAFNOSUPPORT;
-#endif
- return NULL;
-}
More information about the vlc-devel
mailing list