Commit 2815e994 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Set the DCCP service code properly.

Assume RTP converys video (which is fine for MPEG-TS), as we cannot
know if it's only audio anyway.
Signed-off-by: default avatarRémi Denis-Courmont <rem@videolan.org>
parent f8c4e779
...@@ -232,6 +232,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -232,6 +232,8 @@ static int Open( vlc_object_t *p_this )
case IPPROTO_DCCP: case IPPROTO_DCCP:
#ifdef SOCK_DCCP #ifdef SOCK_DCCP
var_Create( p_access, "dccp-service", VLC_VAR_STRING );
var_SetString( p_access, "dccp-service", "RTPV" );
p_sys->fd = net_Connect( p_access, psz_server_addr, i_server_port, p_sys->fd = net_Connect( p_access, psz_server_addr, i_server_port,
SOCK_DCCP, IPPROTO_DCCP ); SOCK_DCCP, IPPROTO_DCCP );
#else #else
......
...@@ -68,6 +68,12 @@ ...@@ -68,6 +68,12 @@
# define EAFNOSUPPORT WSAEAFNOSUPPORT # define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif #endif
#ifdef HAVE_LINUX_DCCP_H
/* TODO: use glibc instead of linux-kernel headers */
# include <linux/dccp.h>
# define SOL_DCCP 269
#endif
extern int rootwrap_bind (int family, int socktype, int protocol, extern int rootwrap_bind (int family, int socktype, int protocol,
const struct sockaddr *addr, size_t alen); const struct sockaddr *addr, size_t alen);
...@@ -118,6 +124,16 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype, ...@@ -118,6 +124,16 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
&(int){ PROTECTION_LEVEL_UNRESTRICTED }, sizeof (int)); &(int){ PROTECTION_LEVEL_UNRESTRICTED }, sizeof (int));
#endif #endif
#ifdef DCCP_SOCKOPT_SERVICE
char *dccps = var_CreateGetNonEmptyString (p_this, "dccp-service");
if (dccps != NULL)
{
setsockopt (fd, SOL_DCCP, DCCP_SOCKOPT_SERVICE, dccps,
(strlen (dccps) + 3) & ~3);
free (dccps);
}
#endif
return fd; return fd;
} }
......
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