aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-24 14:43:03 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-24 14:43:03 +0100
commitc6664242e0700ea0bc10109c7e84c3f9cf7fb9ae (patch)
tree6189919f30f099df68d75cc3ba3d30ec1347467f /libavformat/hlsenc.c
parent98b7a50a2100e3dad96821d2c0adac369652707d (diff)
parentf5f1cf52240759208b42477e2157a7b4409ade10 (diff)
downloadffmpeg-c6664242e0700ea0bc10109c7e84c3f9cf7fb9ae.tar.gz
Merge commit 'f5f1cf52240759208b42477e2157a7b4409ade10'
* commit 'f5f1cf52240759208b42477e2157a7b4409ade10': oggdec: K&R cosmetic formatting hlsenc: correctly report target duration Conflicts: libavformat/oggdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 55074c732f..e85c8b0b53 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -122,15 +122,21 @@ static int hls_window(AVFormatContext *s, int last)
{
HLSContext *hls = s->priv_data;
ListEntry *en;
+ int target_duration = 0;
int ret = 0;
if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0)
goto fail;
+ for (en = hls->list; en; en = en->next) {
+ if (target_duration < en->duration)
+ target_duration = en->duration;
+ }
+
avio_printf(hls->pb, "#EXTM3U\n");
avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
- avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", (int)hls->time);
+ avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_duration);
avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%d\n",
FFMAX(0, hls->number - hls->size));