]> git.sesse.net Git - vlc/commitdiff
Set the DCCP service code properly.
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 2 Mar 2008 19:01:43 +0000 (21:01 +0200)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 2 Mar 2008 19:01:43 +0000 (21:01 +0200)
Assume RTP converys video (which is fine for MPEG-TS), as we cannot
know if it's only audio anyway.

Signed-off-by: Rémi Denis-Courmont <rem@videolan.org>
modules/access/udp.c
src/network/io.c

index c99176cfea8e8c6e43b75e47d341cd6c7b1dca40..790ab79cafcb447d394729533ea7e5322dfd43a9 100644 (file)
@@ -232,6 +232,8 @@ static int Open( vlc_object_t *p_this )
 
         case IPPROTO_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,
                                      SOCK_DCCP, IPPROTO_DCCP );
 #else
index fee2d9f4484160e286012296a71a3362071efa5e..905f605cb8d4c026875481a0f97385e5bd819fef 100644 (file)
 # define EAFNOSUPPORT WSAEAFNOSUPPORT
 #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,
                           const struct sockaddr *addr, size_t alen);
 
@@ -118,6 +124,16 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
                     &(int){ PROTECTION_LEVEL_UNRESTRICTED }, sizeof (int));
 #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;
 }