diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 17:21:50 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 17:21:55 +0400 |
commit | 384dd9804d63fead9bb884a52ff53c17348741e9 (patch) | |
tree | 931bee676ef434095205090478e70fd2ea9a4dd8 | |
parent | 56c71cd599862e02c4b579efe8eace376933efd4 (diff) | |
parent | 30a76487304e7250294c9c0e9fa179bf07fd822a (diff) |
Merge commit '30a76487304e7250294c9c0e9fa179bf07fd822a'
* commit '30a76487304e7250294c9c0e9fa179bf07fd822a':
hlsenc: make segment number unsigned
hlsenc: make EXT-X-MEDIA-SEQUENCE always increase
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/hlsenc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index eafaf452c3..9eed9577b8 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -38,7 +38,8 @@ typedef struct ListEntry { typedef struct HLSContext { const AVClass *class; // Class for private options. - int number; + unsigned number; + int64_t sequence; AVOutputFormat *oformat; AVFormatContext *avf; float time; // Set by a private option. @@ -105,6 +106,8 @@ static int append_entry(HLSContext *hls, uint64_t duration) } else hls->nb_entries++; + hls->sequence++; + return 0; } @@ -138,8 +141,8 @@ 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:%d\n", - FFMAX(0, hls->number - hls->size)); + avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", + FFMAX(0, hls->sequence - hls->size)); for (en = hls->list; en; en = en->next) { avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration); |