aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-04-29 18:37:01 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-04-30 17:52:33 +0200
commita16431034d9bd44182bf844d6bbde2c98bc4e6b5 (patch)
treeaecfa3e8a7ed4b126922cbee08dd02fcc2687df2 /libavformat
parentc7603b3c243331057300337a61464e6ac4a605cb (diff)
downloadffmpeg-a16431034d9bd44182bf844d6bbde2c98bc4e6b5.tar.gz
hls: Factor the sequence computation
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hlsenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index dc51e7e093..79820f0256 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -132,6 +132,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->size);
if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0)
@@ -145,11 +146,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->size));
+ 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:%d,\n", en->duration);