From patchwork Fri Dec 22 07:04:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 6902 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp1938953jad; Thu, 21 Dec 2017 23:05:05 -0800 (PST) X-Google-Smtp-Source: ACJfBovRxGpKtyI3dsjt9GKSiMGDgRlbJrJAO9yvIQ02dHkIsXAdiv75VHlVjrV7CxMmQTZZZoLl X-Received: by 10.223.151.208 with SMTP id t16mr2966726wrb.200.1513926305353; Thu, 21 Dec 2017 23:05:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513926305; cv=none; d=google.com; s=arc-20160816; b=TAHteMRT/sp/kwPSlmpOIhbQGfiN1EHVRMkm9qyybtXK20oFMXzojpwmiSbDXFAQh8 H6A+woWVMtfGNIzNwHXrGMpbh9/CAGm4/aKL/iZ1Pg0zbUvJ9EggERCjP9ZLDrEPBSBw 1U2sKd+n1v4xpT4+GBs9jKmiWPCEZ0U98KSGIm4A7we2PTrQ3W1dsuOTDGHvtHjIL+zA GAzGXrLUucnt67f/QPGM0j97IQgGtBNa1inktuxCbm9H4ehZpBdwa4g8oA9qYB6OIG14 iBE5OGq1XarfLSVvnwD6WRJ/eJCzwK49a+/J7GbXbqKuWxpooilgmxnrAyZjFm8bw6nr pmiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=pV/yOsFggFzet6aWaiDYxkUddS5VGzdUhYVtPzPt3yo=; b=0HFH+QtgmsdPgV5wZHh9RRRzphc6AB/2jO7yWIo6vTNxGD36VGD3h4trEYbiJ4/vVV nQrxBrUX1R9pAP3/u+jh2LMiMjeP42rWSOM3xYsE38/StaRVIGoh1pRpcD8iMbtO0PRe P7jgJsEfFhd0HBYjGfPmSJDiJwXmYQ1oWCi4P2yFBuiSgvSD7tTJldFufd2oWxJKRnGD ruvAL1jS/L4+y7aD3IfXtl07gxeGaNKQunb/nY2tymkuoJZzRQ2lqRmWTq0+VnLTZ8AZ kV/deDE9U61nD9fNV8lNF1RIjDPNNuDjfvUvmDWQD/H5OoykX9mtbvJJDwKLgij1lba6 3b5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=33gHqVoT; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h15si5631903wmc.62.2017.12.21.23.05.04; Thu, 21 Dec 2017 23:05:05 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=33gHqVoT; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 12C57680D03; Fri, 22 Dec 2017 09:04:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i831.smtp2go.com (a2i831.smtp2go.com [103.47.207.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4530E680140 for ; Fri, 22 Dec 2017 09:04:44 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1513927201; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=R16zwo1ULd2hdZZIziq6onHwo+0wYolJa05oJXRT1Wc=; b=33gHqVoT P6SKtC5Q5aym0PS9xfuafZNCm+zw+GDFBqb7EsHXNWhEt11o430YTuJmLBA7mh/6qazLd4b6FoB+3 SeNoqaYUkhZQRvn6usqalQ28X3MnAT77AJYRR4ez/d38ughM0iugMFPyXKxsG1Uoi6uKh5BZF/K/0 UEcS+mKCUY+2V8Vk9UAHSgmP9qle0sloUp0W+7xyJGt3DjklRe1R0MN92dQg14ziDE8ah11Acwu54 IETdalVPCtgC2i2c+K0E3nYCj6Iq8+QNkVdK9Gvg0IacUKb4yiD54Jgx/DfocOc+5Eohu+Y4QEDfk Q6yEGvgGVcD9OswaDb7Nhiokew==; From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Dec 2017 12:34:42 +0530 Message-Id: <1513926282-21191-2-git-send-email-kjeyapal@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513926282-21191-1-git-send-email-kjeyapal@akamai.com> References: <1513926282-21191-1-git-send-email-kjeyapal@akamai.com> X-Smtpcorp-Track: 1-SHO0DIIayr9W.eO6ViVo7t Feedback-ID: 337386m:337386asVRLGB:337386sYbQSjBFym:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH 2/2] avformat/hlsenc: Signal http end of chunk explicitly during hlsenc_io_close() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Karthick Jeyapal MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Karthick Jeyapal Currently http end of chunk is called 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. --- libavformat/hlsenc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 0095ca4..65182c5 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -268,8 +268,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); + ff_http_signal_end_of_chunk(http_url_context); +#endif } }