X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Ftls.c;h=d6a6be3e1e9386f84c68c947dfc854480be6a9ad;hp=61fb2bff853b4edb9b46d99be11f8eec7efc4db0;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/tls.c b/ffmpeg/libavformat/tls.c index 61fb2bf..d6a6be3 100644 --- a/ffmpeg/libavformat/tls.c +++ b/ffmpeg/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)) {