diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-03-18 21:19:00 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-04-29 12:14:11 +0200 |
commit | 5a70a783f04919514efec7751d710b64d8975fd7 (patch) | |
tree | 18ec3d189ccd45ef48f4e56630cbfe699596f3e1 /libavformat | |
parent | 5c08ae4f37281441188447cd04dcaf7cd7ce031f (diff) | |
download | ffmpeg-streaming-5a70a783f04919514efec7751d710b64d8975fd7.zip ffmpeg-streaming-5a70a783f04919514efec7751d710b64d8975fd7.tar.gz |
hls: Add an option to prepend a baseurl to the playlist entries
Useful to generate playlists with absolute paths.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/hlsenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index f9e9678..6d6caa1 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -55,6 +55,7 @@ typedef struct HLSContext { ListEntry *list; ListEntry *end_list; char *basename; + char *baseurl; AVIOContext *pb; } HLSContext; @@ -148,6 +149,8 @@ static int hls_window(AVFormatContext *s, int last) for (en = hls->list; en; en = en->next) { avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration); + if (hls->baseurl) + avio_printf(hls->pb, "%s", hls->baseurl); avio_printf(hls->pb, "%s\n", en->name); } @@ -319,6 +322,7 @@ static const AVOption options[] = { {"hls_time", "segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E}, {"hls_list_size", "maximum number of playlist entries", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E}, {"hls_wrap", "number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E}, + {"hls_base_url", "url to prepend to each playlist entry", OFFSET(baseurl), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E}, { NULL }, }; |