diff options
author | Pierre-Anthony Lemieux <pal@palemieux.com> | 2021-12-14 16:35:14 -0800 |
---|---|---|
committer | Zane van Iperen <zane@zanevaniperen.com> | 2021-12-19 00:35:24 +1000 |
commit | c8b5f2848dcdc7103a5b85c50c4c3082382d1f82 (patch) | |
tree | 699e92914d599952d1bff0c485387175ad1cb694 /libavformat/dashdec.c | |
parent | a8a7c5d502a851d16c4668e03bff12d0e16c32b8 (diff) |
avformat/aviobuf: ffio_copy_url_options
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavformat/dashdec.c')
-rw-r--r-- | libavformat/dashdec.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 983dc85d65..797fe74157 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1833,31 +1833,6 @@ end: return ret; } -static int save_avio_options(AVFormatContext *s) -{ - DASHContext *c = s->priv_data; - const char *opts[] = { - "headers", "user_agent", "cookies", "http_proxy", "referer", "rw_timeout", "icy", NULL }; - const char **opt = opts; - uint8_t *buf = NULL; - int ret = 0; - - while (*opt) { - if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { - if (buf[0] != '\0') { - ret = av_dict_set(&c->avio_opts, *opt, buf, AV_DICT_DONT_STRDUP_VAL); - if (ret < 0) - return ret; - } else { - av_freep(&buf); - } - } - opt++; - } - - return ret; -} - static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **opts) { @@ -2057,7 +2032,7 @@ static int dash_read_header(AVFormatContext *s) c->interrupt_callback = &s->interrupt_callback; - if ((ret = save_avio_options(s)) < 0) + if ((ret = ffio_copy_url_options(s->pb, &c->avio_opts)) < 0) return ret; if ((ret = parse_manifest(s, s->url, s->pb)) < 0) |