diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 14:02:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-30 14:02:19 +0100 |
commit | 19e1c8e4f203a9445aadfc683449968a59f9aa81 (patch) | |
tree | d0ff4a8f37f2e3dbd927c120bf519d76ac527010 | |
parent | 2ce43b37fc46e3744d9d5e1baa1280c48ef7b1bf (diff) | |
parent | 0448f26c97c5ab4858d31e456a4f1738ae783242 (diff) | |
download | ffmpeg-19e1c8e4f203a9445aadfc683449968a59f9aa81.tar.gz |
Merge commit '0448f26c97c5ab4858d31e456a4f1738ae783242'
* commit '0448f26c97c5ab4858d31e456a4f1738ae783242':
hlsenc: keep the playlist to the correct number of items
hlsenc: use the segment filename in the playlist entry
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/hlsenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 75ae134649..ae1184a35f 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -48,6 +48,7 @@ typedef struct HLSContext { int has_video; int64_t start_pts; int64_t end_pts; + int nb_entries; ListEntry *list; ListEntry *end_list; char *basename; @@ -85,9 +86,7 @@ static int append_entry(HLSContext *hls, uint64_t duration) if (!en) return AVERROR(ENOMEM); - av_get_frame_filename(en->name, sizeof(en->name), - av_basename(hls->basename), - hls->number -1); + av_strlcpy(en->name, av_basename(hls->avf->filename), sizeof(en->name)); en->duration = duration; en->next = NULL; @@ -99,11 +98,12 @@ static int append_entry(HLSContext *hls, uint64_t duration) hls->end_list = en; - if (hls->number >= hls->size) { + if (hls->nb_entries >= hls->size) { en = hls->list; hls->list = en->next; av_free(en); - } + } else + hls->nb_entries++; return 0; } |