[vlc-devel] commit: RTP: align RTP port numbers properly ( Rémi Denis-Courmont )
git version control
git at videolan.org
Tue Jun 17 22:22:27 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Jun 17 23:24:23 2008 +0300| [fe4423ddd4038e314d5cf07e75c3da4f42f43bdc]
RTP: align RTP port numbers properly
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe4423ddd4038e314d5cf07e75c3da4f42f43bdc
---
modules/demux/rtp.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/modules/demux/rtp.c b/modules/demux/rtp.c
index f900afb..3ea499a 100644
--- a/modules/demux/rtp.c
+++ b/modules/demux/rtp.c
@@ -174,7 +174,6 @@ static int Open (vlc_object_t *obj)
dport = extract_port (&dhost);
if (dport == 0)
dport = 5004; /* avt-profile-1 port */
- dport = (dport + 1) & ~1; /* RTP is on the "next" even port */
/* Try to connect */
int fd = -1;
@@ -183,8 +182,8 @@ static int Open (vlc_object_t *obj)
{
case IPPROTO_UDP:
case IPPROTO_UDPLITE:
- fd = net_OpenDgram (obj, dhost, dport, shost, sport, AF_UNSPEC,
- tp);
+ fd = net_OpenDgram (obj, dhost, (dport + 1) & ~1,
+ shost, (sport + 1) & ~1, AF_UNSPEC, tp);
break;
case IPPROTO_DCCP:
@@ -196,14 +195,14 @@ static int Open (vlc_object_t *obj)
#ifdef SOCK_DCCP
var_Create (obj, "dccp-service", VLC_VAR_STRING);
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
msg_Err (obj, "DCCP support not included");
#endif
break;
case IPPROTO_TCP:
- fd = net_Connect (obj, shost, sport, SOCK_STREAM, tp);
+ fd = net_Connect (obj, shost, (sport + 1) & ~1, SOCK_STREAM, tp);
break;
}
More information about the vlc-devel
mailing list