diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-10 21:44:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-10 22:28:49 +0200 |
commit | d246397161bb68f12dcb03bbd4f2d315748914fb (patch) | |
tree | e916028b83f1794063bfa30201d7b6ef923cb66a /libavformat | |
parent | 76d1ffffd0b2433c44ac48b8939337294566218b (diff) | |
parent | cd9d6399fd00f5aeacaa90cdc0b74c3570024119 (diff) | |
download | ffmpeg-d246397161bb68f12dcb03bbd4f2d315748914fb.tar.gz |
Merge commit 'cd9d6399fd00f5aeacaa90cdc0b74c3570024119'
* commit 'cd9d6399fd00f5aeacaa90cdc0b74c3570024119':
tls: Support passing old-style tcp options
See: 4f4eb380f0f96dbb7cdd2b812fa92b8b47a0f27c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/tls.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libavformat/tls.c b/libavformat/tls.c index 61fb2bff85..d6a6be3e1e 100644 --- a/libavformat/tls.c +++ b/libavformat/tls.c @@ -168,22 +168,30 @@ static int tls_open(URLContext *h, const char *uri, int flags) TLSContext *c = h->priv_data; int ret; int port; + const char *p; char buf[200], host[200], opts[50] = ""; int numerichost = 0; struct addrinfo hints = { 0 }, *ai = NULL; const char *proxy_path; int use_proxy; - const char *p = strchr(uri, '?'); ff_tls_init(); - if(p && av_find_info_tag(buf, sizeof(buf), "listen", p)) - c->listen = 1; if (c->listen) snprintf(opts, sizeof(opts), "?listen=1"); av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, uri); - ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, "%s", opts); + + p = strchr(uri, '?'); + + if (!p) { + p = opts; + } else { + if (av_find_info_tag(opts, sizeof(opts), "listen", p)) + c->listen = 1; + } + + ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, "%s", p); hints.ai_flags = AI_NUMERICHOST; if (!getaddrinfo(host, NULL, &hints, &ai)) { |