From patchwork Sun Jun 18 22:02:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 4024 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.22.4 with SMTP id 4csp643854vsw; Sun, 18 Jun 2017 15:03:35 -0700 (PDT) X-Received: by 10.28.147.132 with SMTP id v126mr13562790wmd.107.1497823415066; Sun, 18 Jun 2017 15:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497823415; cv=none; d=google.com; s=arc-20160816; b=XQMidmiiz/9USmpUmYkl3jVlVjiQ9x7ocnmkLhKzwsseglceu3aYznt1tVOrt8pi7d rM9VxosIHre2gOMSaWQ4SWMn8SEt37JyiJj9DZETSejKFgDvhA6g/SzhEcNTThm4RfHx 26PVPwaYlbKNiSHKJIQAzCiAXHPc7hc2weoWbOeIDypmdJp9gt3et4mZC6ZqVAEa4Vu1 /UvnNcAHzNCePEKESipdITUvr9BPZaYXRVwMiK1eeexTr2sK5sgJmF3cXw3hlRs+OWVV X1II8o/gwjEwPYJEYpLCT1bqUEpAPfy7hT0S+Xt58gn674/27lNj28Z3KoLEkM5QTFD0 100g== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=FQ1u7H7QLnMZvDOHXsPuRJyjFVGwagoYJjSwJ5E4GJE=; b=S60E5bbSMeBtrbYbRewDAMiSD3WTxyx1e9XcMfSYwegrwRnUiSp3zrJU/Dp+H88M7F w36wYE7ssir5UcMlurDzJcVvBGvo0Tgt/GYez4nhLo5jr38ekcZnidIxYknZuDFU30eq X/dEYwOR5TqTy5476YhdiJcXZkrDN+g4uZy9znyvB3gAaiMRjbxhHRCPuBWYMTK4/sT+ GaL87k+Pq0PF8v83QZ09wwuBoTwv/LQnQ5tC8a1QaaCuTw0rpVZj9z6B5zMjrdIKNDsc p1LIA2AnL0bTW/H18cys1KBCRRWlzmFCak5U47oex0ALwjalqHbfb/wzKe/LN6X38YSV P0xg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v24si8105214wrd.237.2017.06.18.15.03.34; Sun, 18 Jun 2017 15:03:35 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E2E0C68A345; Mon, 19 Jun 2017 01:03:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6910968A2DD for ; Mon, 19 Jun 2017 01:03:03 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DEE98103428; Mon, 19 Jun 2017 00:03:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jw1PxsWM+Ele; Mon, 19 Jun 2017 00:03:06 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 9BFB1103426; Mon, 19 Jun 2017 00:03:06 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Jun 2017 00:02:54 +0200 Message-Id: <20170618220254.21682-4-cus@passwd.hu> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170618220254.21682-1-cus@passwd.hu> References: <20170618220254.21682-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 4/4] avformat/file: increase min/max packet size to 256k for written files 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Buffering more than one packet can be a huge performance improvement for encoding files with small packets (e.g. wav) over SMB/CIFS. Signed-off-by: Marton Balint Acked-by: Michael --- libavformat/file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/file.c b/libavformat/file.c index 3db9cd0b9e..1d321c4205 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -229,6 +229,11 @@ static int file_open(URLContext *h, const char *filename, int flags) h->is_streamed = !fstat(fd, &st) && S_ISFIFO(st.st_mode); + /* Buffer writes more than the default 32k to improve throughput especially + * with networked file systems */ + if (!h->is_streamed && flags & AVIO_FLAG_WRITE) + h->min_packet_size = h->max_packet_size = 262144; + return 0; }