aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-30 20:52:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-30 20:52:58 +0200
commit8522dd380b2a0f98cfaafcf0ae64bd46ac031ae1 (patch)
tree8e60197c31234012a8d7a8b52d26f7215269b151
parent67979b593699ea02ba1b9c60db53e15dcd5fbc1c (diff)
parentc7603b3c243331057300337a61464e6ac4a605cb (diff)
downloadffmpeg-8522dd380b2a0f98cfaafcf0ae64bd46ac031ae1.tar.gz
Merge commit 'c7603b3c243331057300337a61464e6ac4a605cb'
* commit 'c7603b3c243331057300337a61464e6ac4a605cb': hls: Print start_number as first sequence value Conflicts: libavformat/hlsenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/hlsenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index bb798a8a3e..2f20441851 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -41,6 +41,7 @@ typedef struct HLSContext {
const AVClass *class; // Class for private options.
unsigned number;
int64_t sequence;
+ int64_t start_sequence;
AVOutputFormat *oformat;
AVFormatContext *avf;
float time; // Set by a private option.
@@ -146,10 +147,10 @@ static int hls_window(AVFormatContext *s, int last)
avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_duration);
avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
- FFMAX(0, hls->sequence - hls->nb_entries));
+ FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries));
av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
- FFMAX(0, hls->sequence - hls->size));
+ FFMAX(hls->start_sequence, hls->sequence - hls->size));
for (en = hls->list; en; en = en->next) {
avio_printf(hls->pb, "#EXTINF:%f,\n", en->duration);
@@ -199,6 +200,8 @@ static int hls_write_header(AVFormatContext *s)
hls->number = 0;
+
+ hls->sequence = hls->start_sequence;
hls->recording_time = hls->time * AV_TIME_BASE;
hls->start_pts = AV_NOPTS_VALUE;
@@ -327,7 +330,7 @@ static int hls_write_trailer(struct AVFormatContext *s)
#define OFFSET(x) offsetof(HLSContext, x)
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- {"start_number", "set first number in the sequence", OFFSET(sequence),AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},
+ {"start_number", "set first number in the sequence", OFFSET(start_sequence),AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_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_wrap", "set number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E},