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

RTP: align RTP port numbers properly

parent e21ba63b
...@@ -174,7 +174,6 @@ static int Open (vlc_object_t *obj) ...@@ -174,7 +174,6 @@ static int Open (vlc_object_t *obj)
dport = extract_port (&dhost); dport = extract_port (&dhost);
if (dport == 0) if (dport == 0)
dport = 5004; /* avt-profile-1 port */ dport = 5004; /* avt-profile-1 port */
dport = (dport + 1) & ~1; /* RTP is on the "next" even port */
/* Try to connect */ /* Try to connect */
int fd = -1; int fd = -1;
...@@ -183,8 +182,8 @@ static int Open (vlc_object_t *obj) ...@@ -183,8 +182,8 @@ static int Open (vlc_object_t *obj)
{ {
case IPPROTO_UDP: case IPPROTO_UDP:
case IPPROTO_UDPLITE: case IPPROTO_UDPLITE:
fd = net_OpenDgram (obj, dhost, dport, shost, sport, AF_UNSPEC, fd = net_OpenDgram (obj, dhost, (dport + 1) & ~1,
tp); shost, (sport + 1) & ~1, AF_UNSPEC, tp);
break; break;
case IPPROTO_DCCP: case IPPROTO_DCCP:
...@@ -196,14 +195,14 @@ static int Open (vlc_object_t *obj) ...@@ -196,14 +195,14 @@ static int Open (vlc_object_t *obj)
#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");
fd = net_Connect (obj, shost, sport, 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");
#endif #endif
break; break;
case IPPROTO_TCP: case IPPROTO_TCP:
fd = net_Connect (obj, shost, sport, SOCK_STREAM, tp); fd = net_Connect (obj, shost, (sport + 1) & ~1, SOCK_STREAM, tp);
break; break;
} }
......
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