Commit 384dd980 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '30a76487'

* commit '30a76487':
  hlsenc: make segment number unsigned
  hlsenc: make EXT-X-MEDIA-SEQUENCE always increase
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 56c71cd5 30a76487
...@@ -38,7 +38,8 @@ typedef struct ListEntry { ...@@ -38,7 +38,8 @@ typedef struct ListEntry {
typedef struct HLSContext { typedef struct HLSContext {
const AVClass *class; // Class for private options. const AVClass *class; // Class for private options.
int number; unsigned number;
int64_t sequence;
AVOutputFormat *oformat; AVOutputFormat *oformat;
AVFormatContext *avf; AVFormatContext *avf;
float time; // Set by a private option. float time; // Set by a private option.
...@@ -105,6 +106,8 @@ static int append_entry(HLSContext *hls, uint64_t duration) ...@@ -105,6 +106,8 @@ static int append_entry(HLSContext *hls, uint64_t duration)
} else } else
hls->nb_entries++; hls->nb_entries++;
hls->sequence++;
return 0; return 0;
} }
...@@ -138,8 +141,8 @@ static int hls_window(AVFormatContext *s, int last) ...@@ -138,8 +141,8 @@ static int hls_window(AVFormatContext *s, int last)
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", target_duration); 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:%"PRId64"\n",
FFMAX(0, hls->number - hls->size)); FFMAX(0, hls->sequence - hls->size));
for (en = hls->list; en; en = en->next) { for (en = hls->list; en; en = en->next) {
avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration); avio_printf(hls->pb, "#EXTINF:%d,\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