[FFmpeg-cvslog] avformat/hlsenc: Signal http end of chunk(http_shutdown) during hlsenc_io_close()

Karthick Jeyapal git at videolan.org
Mon Dec 25 06:08:53 EET 2017


ffmpeg | branch: master | Karthick Jeyapal <kjeyapal at akamai.com> | Mon Dec 25 12:08:06 2017 +0800| [be2da4c52221c5ec0769ccea675a896e324d1f41] | committer: Steven Liu

avformat/hlsenc: Signal http end of chunk(http_shutdown) during hlsenc_io_close()

Currently http end of chunk is signalled implicitly in hlsenc_io_open().
This mean playlists http writes would have to wait upto a segment duration to signal end of chunk causing delays.
This patch will fix that problem and improve performance.

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

 libavformat/hlsenc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index bbc2742dc7..b850b1a320 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -269,8 +269,13 @@ static void hlsenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filename
 
     if (!http_base_proto || !hls->http_persistent || hls->key_info_file || hls->encrypt) {
         ff_format_io_close(s, pb);
+#if CONFIG_HTTP_PROTOCOL
     } else {
+        URLContext *http_url_context = ffio_geturlcontext(*pb);
+        av_assert0(http_url_context);
         avio_flush(*pb);
+        ffurl_shutdown(http_url_context, AVIO_FLAG_WRITE);
+#endif
     }
 }
 



More information about the ffmpeg-cvslog mailing list