From dadedd20e5e841d6d71c71ba4b2056726517c70a Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Sat, 22 Nov 2008 14:16:54 +0100 Subject: [PATCH] Do not refuse to open odd port number with RTP input access. It is a common pratice to allows it for at least TS over RTP. I have added an error message when using a odd port. --- modules/access/rtp/rtp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c index 5028aa101f..0fb398feb3 100644 --- a/modules/access/rtp/rtp.c +++ b/modules/access/rtp/rtp.c @@ -179,12 +179,15 @@ static int Open (vlc_object_t *obj) { case IPPROTO_UDP: case IPPROTO_UDPLITE: - fd = net_OpenDgram (obj, dhost, (dport + 1) & ~1, - shost, (sport + 1) & ~1, AF_UNSPEC, tp); + if ((dport & 1) != 0 || (sport & 1) != 0) + msg_Err (obj, "Using odd port number is higly discouraged"); + + fd = net_OpenDgram (obj, dhost, dport, + shost, sport, AF_UNSPEC, tp); if (fd == -1) break; - rtcp_fd = net_OpenDgram (obj, dhost, dport | 1, shost, - sport ? (sport | 1) : 0, AF_UNSPEC, tp); + rtcp_fd = net_OpenDgram (obj, dhost, dport + 1, shost, + sport ? (sport + 1) : 0, AF_UNSPEC, tp); break; case IPPROTO_DCCP: -- GitLab