1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Merge commit '5a70a783f04919514efec7751d710b64d8975fd7'

* commit '5a70a783f04919514efec7751d710b64d8975fd7':
  hls: Add an option to prepend a baseurl to the playlist entries

Conflicts:
	doc/muxers.texi
	libavformat/hlsenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-04-29 16:37:22 +02:00
commit 217f6c53e5
2 changed files with 8 additions and 0 deletions

View File

@ -233,6 +233,10 @@ to @var{wrap}.
Start the playlist sequence number from @var{number}. Default value is Start the playlist sequence number from @var{number}. Default value is
0. 0.
@item hls_base_url @var{baseurl}
Append @var{baseurl} to every entry in the playlist.
Useful to generate playlists with absolute paths.
Note that the playlist sequence number must be unique for each segment Note that the playlist sequence number must be unique for each segment
and it is not to be confused with the segment filename sequence number and it is not to be confused with the segment filename sequence number
which can be cyclic, for example if the @option{wrap} option is which can be cyclic, for example if the @option{wrap} option is

View File

@ -55,6 +55,7 @@ typedef struct HLSContext {
ListEntry *list; ListEntry *list;
ListEntry *end_list; ListEntry *end_list;
char *basename; char *basename;
char *baseurl;
AVIOContext *pb; AVIOContext *pb;
} HLSContext; } HLSContext;
@ -149,6 +150,8 @@ static int hls_window(AVFormatContext *s, int last)
for (en = hls->list; en; en = en->next) { for (en = hls->list; en; en = en->next) {
avio_printf(hls->pb, "#EXTINF:%f,\n", en->duration); avio_printf(hls->pb, "#EXTINF:%f,\n", en->duration);
if (hls->baseurl)
avio_printf(hls->pb, "%s", hls->baseurl);
avio_printf(hls->pb, "%s\n", en->name); avio_printf(hls->pb, "%s\n", en->name);
} }
@ -325,6 +328,7 @@ static const AVOption options[] = {
{"hls_time", "set segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E}, {"hls_time", "set segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E},
{"hls_list_size", "set maximum number of playlist entries", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E}, {"hls_list_size", "set maximum number of playlist entries", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E},
{"hls_wrap", "set number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E}, {"hls_wrap", "set 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 }, { NULL },
}; };