Commit dadedd20 authored by Laurent Aimar's avatar Laurent Aimar

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.
parent 94a2e5cd
......@@ -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:
......
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