Commit 0f5a40c2 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'ee37d581'

* commit 'ee37d581':
  rtpproto: Allow specifying a separate rtcp port in ff_rtp_set_remote_url
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 2ee58af5 ee37d581
......@@ -61,18 +61,27 @@ int ff_rtp_set_remote_url(URLContext *h, const char *uri)
{
RTPContext *s = h->priv_data;
char hostname[256];
int port;
int port, rtcp_port;
const char *p;
char buf[1024];
char path[1024];
av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
path, sizeof(path), uri);
rtcp_port = port + 1;
p = strchr(uri, '?');
if (p) {
if (av_find_info_tag(buf, sizeof(buf), "rtcpport", p)) {
rtcp_port = strtol(buf, NULL, 10);
}
}
ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port, "%s", path);
ff_udp_set_remote_url(s->rtp_hd, buf);
ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port + 1, "%s", path);
ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, rtcp_port, "%s", path);
ff_udp_set_remote_url(s->rtcp_hd, buf);
return 0;
}
......
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