mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-02-05 03:26:17 +00:00
avformat/http: simplify chained_options copying
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ffaf2074eb
commit
deccb4d827
@ -207,8 +207,7 @@ static int http_open_cnx(URLContext *h, AVDictionary **options)
|
|||||||
HTTPContext *s = h->priv_data;
|
HTTPContext *s = h->priv_data;
|
||||||
int location_changed, attempts = 0, redirects = 0;
|
int location_changed, attempts = 0, redirects = 0;
|
||||||
redo:
|
redo:
|
||||||
if (attempts > 0)
|
av_dict_copy(options, s->chained_options, 0);
|
||||||
av_dict_copy(options, s->chained_options, 0);
|
|
||||||
|
|
||||||
cur_auth_type = s->auth_state.auth_type;
|
cur_auth_type = s->auth_state.auth_type;
|
||||||
cur_proxy_auth_type = s->auth_state.auth_type;
|
cur_proxy_auth_type = s->auth_state.auth_type;
|
||||||
@ -271,7 +270,6 @@ int ff_http_do_new_request(URLContext *h, const char *uri)
|
|||||||
if (!s->location)
|
if (!s->location)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
av_dict_copy(&options, s->chained_options, 0);
|
|
||||||
ret = http_open_cnx(h, &options);
|
ret = http_open_cnx(h, &options);
|
||||||
av_dict_free(&options);
|
av_dict_free(&options);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1139,7 +1137,6 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
|
|||||||
s->hd = NULL;
|
s->hd = NULL;
|
||||||
|
|
||||||
/* if it fails, continue on old connection */
|
/* if it fails, continue on old connection */
|
||||||
av_dict_copy(&options, s->chained_options, 0);
|
|
||||||
if ((ret = http_open_cnx(h, &options)) < 0) {
|
if ((ret = http_open_cnx(h, &options)) < 0) {
|
||||||
av_dict_free(&options);
|
av_dict_free(&options);
|
||||||
memcpy(s->buffer, old_buf, old_buf_size);
|
memcpy(s->buffer, old_buf, old_buf_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user