diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-19 01:55:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-19 02:00:06 +0100 |
commit | e161b079dee12b11c40df67cf422edeb84772bbe (patch) | |
tree | fe5000d84e5fc4049395822c4bf8b4d600851782 /libavformat/tls.c | |
parent | 36a60fad6215db39e9cd9523e3425f64464046c7 (diff) | |
parent | ff3755cbde9bdd2a4dc50e4432f72ddeef1a85ac (diff) | |
download | ffmpeg-e161b079dee12b11c40df67cf422edeb84772bbe.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
configure: add check for w32threads to enable it automatically
rtmp: do not hardcode invoke numbers
cinepack: return non-generic errors
fate-lavf-ts: use -mpegts_transport_stream_id option.
Add an APIchanges entry and a minor bump for avio changes.
avio: Mark the old interrupt callback mechanism as deprecated
avplay: Set the new interrupt callback
avconv: Set new interrupt callbacks for all AVFormatContexts, use avio_open2() everywhere
cinepak: remove redundant coordinate checks
cinepak: check strip_size
cinepak, simplify, use AV_RB24()
cinepak: simplify, use FFMIN()
cinepak: Fix division by zero, ask for sample if encoded_buf_size is 0
applehttp: Fix seeking in streams not starting at DTS=0
http: Don't use the normal http proxy mechanism for https
tls: Handle connection via a http proxy
http: Reorder two code blocks
http: Add a new protocol for opening connections via http proxies
http: Split out the non-chunked buffer reading part from http_read
segafilm: add support for raw videos
...
Conflicts:
avconv.c
configure
doc/APIchanges
libavcodec/cinepak.c
libavformat/applehttp.c
libavformat/version.h
tests/lavf-regression.sh
tests/ref/lavf/ts
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/tls.c')
-rw-r--r-- | libavformat/tls.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/tls.c b/libavformat/tls.c index 72c2b85016..339b799322 100644 --- a/libavformat/tls.c +++ b/libavformat/tls.c @@ -111,9 +111,15 @@ static int tls_open(URLContext *h, const char *uri, int flags) char buf[200], host[200]; int numerichost = 0; struct addrinfo hints = { 0 }, *ai = NULL; + const char *proxy_path; + int use_proxy; ff_tls_init(); + proxy_path = getenv("http_proxy"); + use_proxy = (proxy_path != NULL) && !getenv("no_proxy") && + av_strstart(proxy_path, "http://", NULL); + av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, uri); ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, NULL); @@ -123,6 +129,17 @@ static int tls_open(URLContext *h, const char *uri, int flags) freeaddrinfo(ai); } + if (use_proxy) { + char proxy_host[200], proxy_auth[200], dest[200]; + int proxy_port; + av_url_split(NULL, 0, proxy_auth, sizeof(proxy_auth), + proxy_host, sizeof(proxy_host), &proxy_port, NULL, 0, + proxy_path); + ff_url_join(dest, sizeof(dest), NULL, NULL, host, port, NULL); + ff_url_join(buf, sizeof(buf), "httpproxy", proxy_auth, proxy_host, + proxy_port, "/%s", dest); + } + ret = ffurl_open(&c->tcp, buf, AVIO_FLAG_READ_WRITE, &h->interrupt_callback, NULL); if (ret) |