Commit 63dbcdb8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

RTP: open the RTCP port

At least, we won't be sending ICMP errors from now.
parent 91467d76
...@@ -176,7 +176,7 @@ static int Open (vlc_object_t *obj) ...@@ -176,7 +176,7 @@ static int Open (vlc_object_t *obj)
dport = 5004; /* avt-profile-1 port */ dport = 5004; /* avt-profile-1 port */
/* Try to connect */ /* Try to connect */
int fd = -1; int fd = -1, rtcp_fd = -1;
switch (tp) switch (tp)
{ {
...@@ -184,6 +184,10 @@ static int Open (vlc_object_t *obj) ...@@ -184,6 +184,10 @@ static int Open (vlc_object_t *obj)
case IPPROTO_UDPLITE: case IPPROTO_UDPLITE:
fd = net_OpenDgram (obj, dhost, (dport + 1) & ~1, fd = net_OpenDgram (obj, dhost, (dport + 1) & ~1,
shost, (sport + 1) & ~1, AF_UNSPEC, tp); shost, (sport + 1) & ~1, AF_UNSPEC, tp);
if (fd == -1)
break;
rtcp_fd = net_OpenDgram (obj, dhost, dport | 1, shost,
sport ? (sport | 1) : 0, AF_UNSPEC, tp);
break; break;
case IPPROTO_DCCP: case IPPROTO_DCCP:
...@@ -194,7 +198,7 @@ static int Open (vlc_object_t *obj) ...@@ -194,7 +198,7 @@ static int Open (vlc_object_t *obj)
#endif #endif
#ifdef SOCK_DCCP #ifdef SOCK_DCCP
var_Create (obj, "dccp-service", VLC_VAR_STRING); var_Create (obj, "dccp-service", VLC_VAR_STRING);
var_SetString (obj, "dccp-service", "RTPV"); var_SetString (obj, "dccp-service", "RTPV"); /* FIXME: RTPA? */
fd = net_Connect (obj, shost, (sport + 1) & ~1, SOCK_DCCP, tp); fd = net_Connect (obj, shost, (sport + 1) & ~1, SOCK_DCCP, tp);
#else #else
msg_Err (obj, "DCCP support not included"); msg_Err (obj, "DCCP support not included");
...@@ -216,6 +220,8 @@ static int Open (vlc_object_t *obj) ...@@ -216,6 +220,8 @@ static int Open (vlc_object_t *obj)
if (p_sys == NULL) if (p_sys == NULL)
{ {
net_Close (fd); net_Close (fd);
if (rtcp_fd != -1)
net_Close (rtcp_fd);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -279,6 +285,8 @@ static void Close (vlc_object_t *obj) ...@@ -279,6 +285,8 @@ static void Close (vlc_object_t *obj)
srtp_destroy (p_sys->srtp); srtp_destroy (p_sys->srtp);
if (p_sys->session) if (p_sys->session)
rtp_session_destroy (demux, p_sys->session); rtp_session_destroy (demux, p_sys->session);
if (p_sys->rtcp_fd != -1)
net_Close (p_sys->rtcp_fd);
net_Close (p_sys->fd); net_Close (p_sys->fd);
free (p_sys); free (p_sys);
} }
......
...@@ -45,6 +45,7 @@ struct demux_sys_t ...@@ -45,6 +45,7 @@ struct demux_sys_t
rtp_session_t *session; rtp_session_t *session;
struct srtp_session_t *srtp; struct srtp_session_t *srtp;
int fd; int fd;
int rtcp_fd;
unsigned caching; unsigned caching;
unsigned timeout; unsigned timeout;
......
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