From c8b5f2848dcdc7103a5b85c50c4c3082382d1f82 Mon Sep 17 00:00:00 2001 From: Pierre-Anthony Lemieux Date: Tue, 14 Dec 2021 16:35:14 -0800 Subject: avformat/aviobuf: ffio_copy_url_options Signed-off-by: Pierre-Anthony Lemieux Signed-off-by: Zane van Iperen --- libavformat/hls.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'libavformat/hls.c') diff --git a/libavformat/hls.c b/libavformat/hls.c index 557faf8e8d..8c526f748f 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1717,28 +1717,6 @@ static int64_t select_cur_seq_no(HLSContext *c, struct playlist *pls) return pls->start_seq_no; } -static int save_avio_options(AVFormatContext *s) -{ - HLSContext *c = s->priv_data; - static const char * const opts[] = { - "headers", "http_proxy", "user_agent", "cookies", "referer", "rw_timeout", "icy", NULL }; - const char * const * opt = opts; - uint8_t *buf; - int ret = 0; - - while (*opt) { - if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN | AV_OPT_ALLOW_NULL, &buf) >= 0) { - ret = av_dict_set(&c->avio_opts, *opt, buf, - AV_DICT_DONT_STRDUP_VAL); - if (ret < 0) - return ret; - } - opt++; - } - - return ret; -} - static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **opts) { @@ -1884,7 +1862,7 @@ static int hls_read_header(AVFormatContext *s) c->first_timestamp = AV_NOPTS_VALUE; c->cur_timestamp = AV_NOPTS_VALUE; - if ((ret = save_avio_options(s)) < 0) + if ((ret = ffio_copy_url_options(s->pb, &c->avio_opts)) < 0) return ret; /* XXX: Some HLS servers don't like being sent the range header, -- cgit v1.2.3