diff options
author | vectronic <hello.vectronic@gmail.com> | 2019-10-04 22:56:01 +0100 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-10-08 14:57:44 +0800 |
commit | e81c686a95b19966def357ccb113bd4e5e269772 (patch) | |
tree | 3b5beec6c06c7e7317318aab108d8800f72a9e37 /libavformat/http.c | |
parent | afab93ccd097169b2a598768af4a9273332f3619 (diff) | |
download | ffmpeg-e81c686a95b19966def357ccb113bd4e5e269772.tar.gz |
avformat/http: add ff_http_do_new_request2 for options
add ff_http_do_new_request2() which supports options to be applied to
HTTPContext after initialisation with the new uri
Signed-off-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: vectronic <hello.vectronic@gmail.com>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r-- | libavformat/http.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c index 71dd6c2b1f..85cbd06092 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -320,8 +320,11 @@ int ff_http_get_shutdown_status(URLContext *h) return ret; } +int ff_http_do_new_request(URLContext *h, const char *uri) { + return ff_http_do_new_request2(h, uri, NULL); +} -int ff_http_do_new_request(URLContext *h, const char *uri) +int ff_http_do_new_request2(URLContext *h, const char *uri, AVDictionary **opts) { HTTPContext *s = h->priv_data; AVDictionary *options = NULL; @@ -366,6 +369,9 @@ int ff_http_do_new_request(URLContext *h, const char *uri) if (!s->location) return AVERROR(ENOMEM); + if ((ret = av_opt_set_dict(s, opts)) < 0) + return ret; + av_log(s, AV_LOG_INFO, "Opening \'%s\' for %s\n", uri, h->flags & AVIO_FLAG_WRITE ? "writing" : "reading"); ret = http_open_cnx(h, &options); av_dict_free(&options); |