diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-01 15:51:37 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-01 15:51:44 +0400 |
commit | 0f5a40c2a4bc2ae6548d75b9a9f3ef568e995883 (patch) | |
tree | 7d0489831e464cd9405683fa4a27a58febfd8c29 /libavformat/rtpproto.c | |
parent | 2ee58af53e1cb788f9b8d50530ec1f5f73c431b6 (diff) | |
parent | ee37d5811caa8f4ad125a37fe6ce3f9e66cd72f2 (diff) |
Merge commit 'ee37d5811caa8f4ad125a37fe6ce3f9e66cd72f2'
* commit 'ee37d5811caa8f4ad125a37fe6ce3f9e66cd72f2':
rtpproto: Allow specifying a separate rtcp port in ff_rtp_set_remote_url
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpproto.c')
-rw-r--r-- | libavformat/rtpproto.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index ba699b5708..00a3bcd3ba 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -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; } |