[FFmpeg-devel] [PATCH] Fix for hls bug when hls_list_size=0.

Senthil senthil.codr at gmail.com
Sat Mar 1 08:55:13 CET 2014


HLS: Handle the case when hls_list_size=0.  Play list file should contain
all the segments.  Fixes bug #3376.

Signed-off-by: Senthilnathan M <senthil.codr at gmail.com>
---
 libavformat/hlsenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3b50397..1b5ef0e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -102,7 +102,7 @@ static int append_entry(HLSContext *hls, uint

     hls->end_list = en;

-    if (hls->nb_entries >= hls->size) {
+    if (hls->size && hls->nb_entries >= hls->size) {
         en = hls->list;
         hls->list = en->next;
         av_free(en);
@@ -145,7 +145,7 @@ static int hls_window(AVFormatContext *s, int
     avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
     avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_du
     avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
-                FFMAX(0, hls->sequence - hls->size));
+                FFMAX(0, hls->sequence - hls->nb_entries));

     for (en = hls->list; en; en = en->next) {
         avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration);
-- 
1.7.9.5


More information about the ffmpeg-devel mailing list