summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/muxers.texi4
-rw-r--r--libavformat/segment.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 30559d7d67..6362ed21a5 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -789,8 +789,8 @@ segments. If 0 the list file will contain all the segments. Default
value is 0.
@item segment_list_entry_prefix @var{prefix}
-Set @var{prefix} to prepend to the name of each entry filename. By
-default no prefix is applied.
+Prepend @var{prefix} to each entry. Useful to generate absolute paths.
+By default no prefix is applied.
@item segment_list_type @var{type}
Specify the format for the segment list file.
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 3568d2a0de..c8dcf62dc2 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -73,7 +73,7 @@ typedef struct {
char *list; ///< filename for the segment list file
int list_flags; ///< flags affecting list generation
int list_size; ///< number of entries for the segment list file
- char *list_entry_prefix; ///< prefix to add to list entry filenames
+ char *entry_prefix; ///< prefix to add to list entry filenames
ListType list_type; ///< set the list type
AVIOContext *list_pb; ///< list file put-byte context
char *time_str; ///< segment duration specification string
@@ -172,14 +172,14 @@ static int set_segment_filename(AVFormatContext *s)
/* copy modified name in list entry */
size = strlen(av_basename(oc->filename)) + 1;
- if (seg->list_entry_prefix)
- size += strlen(seg->list_entry_prefix);
+ if (seg->entry_prefix)
+ size += strlen(seg->entry_prefix);
seg->cur_entry.filename = av_mallocz(size);
if (!seg->cur_entry.filename)
return AVERROR(ENOMEM);
snprintf(seg->cur_entry.filename, size, "%s%s",
- seg->list_entry_prefix ? seg->list_entry_prefix : "",
+ seg->entry_prefix ? seg->entry_prefix : "",
av_basename(oc->filename));
return 0;
@@ -783,7 +783,6 @@ static const AVOption options[] = {
{ "live", "enable live-friendly list generation (useful for HLS)", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_LIST_FLAG_LIVE }, INT_MIN, INT_MAX, E, "list_flags"},
{ "segment_list_size", "set the maximum number of playlist entries", OFFSET(list_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
- { "segment_list_entry_prefix", "set prefix to prepend to each list entry filename", OFFSET(list_entry_prefix), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
{ "segment_list_type", "set the segment list type", OFFSET(list_type), AV_OPT_TYPE_INT, {.i64 = LIST_TYPE_UNDEFINED}, -1, LIST_TYPE_NB-1, E, "list_type" },
{ "flat", "flat format", 0, AV_OPT_TYPE_CONST, {.i64=LIST_TYPE_FLAT }, INT_MIN, INT_MAX, E, "list_type" },
@@ -798,6 +797,7 @@ static const AVOption options[] = {
{ "segment_times", "set segment split time points", OFFSET(times_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E },
{ "segment_frames", "set segment split frame numbers", OFFSET(frames_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E },
{ "segment_wrap", "set number after which the index wraps", OFFSET(segment_idx_wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "segment_list_entry_prefix", "set base url prefix for segments", OFFSET(entry_prefix), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
{ "segment_start_number", "set the sequence number of the first segment", OFFSET(segment_idx), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
{ "segment_wrap_number", "set the number of wrap before the first segment", OFFSET(segment_idx_wrap_nb), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },