avformat/dashenc: Signal http end of chunk(http_shutdown) explicitly
authorKarthick Jeyapal <kjeyapal@akamai.com>
Tue, 2 Jan 2018 08:19:57 +0000 (13:49 +0530)
committerKarthick Jeyapal <kjeyapal@akamai.com>
Fri, 26 Jan 2018 01:56:09 +0000 (07:26 +0530)
Currently http end of chunk is signalled implicitly in dashenc_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.

libavformat/dashenc.c

index 38cc592..d1e4d74 100644 (file)
@@ -149,7 +149,10 @@ static void dashenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filenam
         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
     }
 }