summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2021-05-29 15:27:18 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2021-05-30 09:21:19 +0530
commit51f1194edae2020ec99b816bd045a29db0e469f8 (patch)
treed31d1cfa102d75d8459e3b623497cea147de22da /libavformat/hls.c
parent8d0fea81c736280ff19283b05cd0ad935d1e35c5 (diff)
avformat/hls: relay format options to segment demuxer
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro> Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 8fc6924c90..c2ca23e973 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -207,6 +207,7 @@ typedef struct HLSContext {
int64_t cur_timestamp;
AVIOInterruptCB *interrupt_callback;
AVDictionary *avio_opts;
+ AVDictionary *seg_format_opts;
char *allowed_extensions;
int max_reload;
int http_persistent;
@@ -1959,6 +1960,7 @@ static int hls_read_header(AVFormatContext *s)
struct playlist *pls = c->playlists[i];
const AVInputFormat *in_fmt = NULL;
char *url;
+ AVDictionary *seg_format_opts = NULL;
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
@@ -2017,7 +2019,10 @@ static int hls_read_header(AVFormatContext *s)
if ((ret = ff_copy_whiteblacklists(pls->ctx, s)) < 0)
goto fail;
- ret = avformat_open_input(&pls->ctx, pls->segments[0]->url, in_fmt, NULL);
+ av_dict_copy(&seg_format_opts, c->seg_format_opts, 0);
+
+ ret = avformat_open_input(&pls->ctx, pls->segments[0]->url, in_fmt, &seg_format_opts);
+ av_dict_free(&seg_format_opts);
if (ret < 0)
goto fail;
@@ -2403,6 +2408,8 @@ static const AVOption hls_options[] = {
OFFSET(http_multiple), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, FLAGS},
{"http_seekable", "Use HTTP partial requests, 0 = disable, 1 = enable, -1 = auto",
OFFSET(http_seekable), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, FLAGS},
+ {"seg_format_options", "Set options for segment demuxer",
+ OFFSET(seg_format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS},
{NULL}
};