diff mbox

[FFmpeg-devel,2/2] avformat/dashenc: Signal http end of chunk(http_shutdown) explicitly

Message ID 1514875698-28017-2-git-send-email-kjeyapal@akamai.com
State Accepted
Commit 18e2ac032e9d7258e57ec033962fca665f2a0be5
Headers show

Commit Message

Jeyapal, Karthick Jan. 2, 2018, 6:48 a.m. UTC
From: Karthick Jeyapal <kjeyapal@akamai.com>

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 | 3 +++
 1 file changed, 3 insertions(+)

Comments

Liu Steven Jan. 2, 2018, 8:12 a.m. UTC | #1
> On 2 Jan 2018, at 14:48, Karthick J <kjeyapal@akamai.com> wrote:
> 
> From: Karthick Jeyapal <kjeyapal@akamai.com>
> 
> 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 | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index c4c112b..c328db2 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -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
>     }
> }
> -- 
> 1.9.1
> 


LGTM

Thanks
Steven
diff mbox

Patch

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index c4c112b..c328db2 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -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
     }
 }