Merge commit '5c08ae4f37281441188447cd04dcaf7cd7ce031f'

* commit '5c08ae4f37281441188447cd04dcaf7cd7ce031f':
  segment: Add an option to prepend a string to the list entries

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

See: 5e278c19c7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-04-29 15:42:04 +02:00
commit fd601ba6b1
2 changed files with 7 additions and 7 deletions

View File

@ -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.

View File

@ -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 },