Commit c6664242 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'f5f1cf52'

* commit 'f5f1cf52':
  oggdec: K&R cosmetic formatting
  hlsenc: correctly report target duration

Conflicts:
	libavformat/oggdec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 98b7a50a f5f1cf52
...@@ -122,15 +122,21 @@ static int hls_window(AVFormatContext *s, int last) ...@@ -122,15 +122,21 @@ static int hls_window(AVFormatContext *s, int last)
{ {
HLSContext *hls = s->priv_data; HLSContext *hls = s->priv_data;
ListEntry *en; ListEntry *en;
int target_duration = 0;
int ret = 0; int ret = 0;
if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE, if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0) &s->interrupt_callback, NULL)) < 0)
goto fail; 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, "#EXTM3U\n");
avio_printf(hls->pb, "#EXT-X-VERSION:3\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", avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%d\n",
FFMAX(0, hls->number - hls->size)); FFMAX(0, hls->number - hls->size));
......
This diff is collapsed.
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