[FFmpeg-cvslog] avformat/hlsenc: fix incomplete write of subtitle HLS playlist

Franklin Phillips git at videolan.org
Mon Sep 5 10:23:20 EEST 2016


ffmpeg | branch: master | Franklin Phillips <franklinphillips9p8 at inbox.lv> | Fri Sep  2 20:20:21 2016 +0100| [cefce6e2c1e3b94bc6f41b96dbdfa4919e8c29d7] | committer: Michael Niedermayer

avformat/hlsenc: fix incomplete write of subtitle HLS playlist

This patch is a fix for the bug with ticket number 5812
(https://trac.ffmpeg.org/ticket/5812).

Basically, the bug is that the last segment and the "#EXT-X-ENDLIST"
tag are not being written to the subtitle playlist file when
converting a file with subtitles to the HLS format. The reason for
this seem to be that the filename for the subtitle file is being freed
too early. This solution is simply to free that memory after it's last
use in the "hls_window" function.

Signed-off-by: Franklin Phillips <franklinphillips9p8 at inbox.lv>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cefce6e2c1e3b94bc6f41b96dbdfa4919e8c29d7
---

 libavformat/hlsenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 81b7efa..c0b5ef2 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -968,15 +968,15 @@ static int hls_write_trailer(struct AVFormatContext *s)
     av_freep(&hls->basename);
     avformat_free_context(oc);
 
+    hls->avf = NULL;
+    hls_window(s, 1);
+
     if (vtt_oc) {
         av_freep(&hls->vtt_basename);
         av_freep(&hls->vtt_m3u8_name);
         avformat_free_context(vtt_oc);
     }
 
-    hls->avf = NULL;
-    hls_window(s, 1);
-
     hls_free_segments(hls->segments);
     hls_free_segments(hls->old_segments);
     return 0;



More information about the ffmpeg-cvslog mailing list