Commit 5b4c8aac authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'a1643103'

* commit 'a1643103':
  hls: Factor the sequence computation

Conflicts:
	libavformat/hlsenc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 8522dd38 a1643103
......@@ -133,6 +133,7 @@ static int hls_window(AVFormatContext *s, int last)
ListEntry *en;
int target_duration = 0;
int ret = 0;
int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries);
if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0)
......@@ -146,11 +147,10 @@ static int hls_window(AVFormatContext *s, int last)
avio_printf(hls->pb, "#EXTM3U\n");
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(hls->start_sequence, hls->sequence - hls->nb_entries));
avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
FFMAX(hls->start_sequence, hls->sequence - hls->size));
sequence);
for (en = hls->list; en; en = en->next) {
avio_printf(hls->pb, "#EXTINF:%f,\n", en->duration);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment