From patchwork Fri Jan 3 18:15:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17185 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a05:6214:1865:0:0:0:0 with SMTP id eh5csp1023066qvb; Fri, 3 Jan 2020 10:16:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxwZyoKaP+fobL5TNh0aIIIzua2x47vFz9ZMoq3xvzP1HZ+1b/XdZ/Oaal/urHwx8fHhJJY X-Received: by 2002:a05:6402:305b:: with SMTP id bu27mr95485881edb.191.1578075363651; Fri, 03 Jan 2020 10:16:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578075363; cv=none; d=google.com; s=arc-20160816; b=PCck8vgHeu2Mg6khe2+CL6KyggbKHGFfhD4zn0FuZk8IfLX7ghCt2noaB7B89PSF9L 17tVDmyxRlyBabmOR32CqSMpeSdAO47rnFQ3kMh6Y5TtvdD01t8yP4Z+oEhLlI1KUamm SAymjm1CNwQNRim2BOMKkPHu8pBWJrItG6lfxEZ2tV4aWZGuyssBI2cJU8DVsCefvbai mOcQBUHtyvHNtIA3HW7hTdxKsQCemrAZxv5hYQfR8Pv+Gdus/uN4ljmWIaApSkn/hxDW lsVpHdQVXAd14+yZU7hMV5RgoF+M6DU+AhV+uMzRYpm79In16+/LgFj7WT8yzwITZFp1 75sQ== 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:message-id:date:to:from:delivered-to; bh=al+vrPvckkW6H10PUl/SHBF2CtlMM47IyxJNVKEObN8=; b=ceWH/2OxY7XR2VHTjbZnr63OT3kVeFIxFc26WOqAJXAohcJeEJaomcHSRe5MOp3A2M oVgfXbspJMr6QSAGctPSrAmk6n+UhX5aHKeoBvDa7WbRsmFxyiO6QX3INUvuMqVdGO21 SmTpcSetG2Z06usHhxQmDKfPp66QrrybAbrb/ZN+ObqyVYVE+tEPMgMLkAJJnSHYS1UW QxMUi5QT8xVml2WPaRPFfDgpruILI7QNZsAM3qOKCfO6twkYjsFJ+BHKJnRpEYuMBa5K 4DnpLNEExgDG/31Fw+tQS/mCYxhzJhgOtxHQMNhNelQ7x6ZGo6sRHf4c/nmOXopmP/Ry rCBQ== 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 dn15si38651988edb.218.2020.01.03.10.16.03; Fri, 03 Jan 2020 10:16:03 -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; 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 63AF768A601; Fri, 3 Jan 2020 20:16:01 +0200 (EET) 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 63165689FE7 for ; Fri, 3 Jan 2020 20:15:55 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2886AE36BA; Fri, 3 Jan 2020 19:15:55 +0100 (CET) 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 ERPzsbLAY7T4; Fri, 3 Jan 2020 19:15:53 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2376EE3341; Fri, 3 Jan 2020 19:15:53 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 3 Jan 2020 19:15:46 +0100 Message-Id: <20200103181548.20535-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH 1/3] avformat: remove unneded avio_flush() calls before calling avio_close_dyn_buf() 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" X-TUID: zhDEu9S7xzAc Content-Length: 3287 avio_close_dyn_buf() also does avio_flush(). Signed-off-by: Marton Balint --- libavformat/hlsenc.c | 2 -- libavformat/oggenc.c | 1 - libavformat/rtpdec.c | 2 -- 3 files changed, 5 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 561e3ff736..d130f03ea6 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -459,7 +459,6 @@ static int flush_dynbuf(VariantStream *vs, int *range_length) // flush av_write_frame(ctx, NULL); - avio_flush(ctx->pb); // write out to file *range_length = avio_close_dyn_buf(ctx->pb, &vs->temp_buffer); @@ -2548,7 +2547,6 @@ static int hls_write_trailer(struct AVFormatContext *s) if (!vs->init_range_length) { uint8_t *buffer = NULL; av_write_frame(oc, NULL); /* Flush any buffered data */ - avio_flush(oc->pb); range_length = avio_close_dyn_buf(oc->pb, &buffer); avio_write(vs->out, buffer, range_length); diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index d3ae07351d..04f7813083 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -133,7 +133,6 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags) avio_write(pb, page->data, page->size); ogg_update_checksum(s, pb, crc_offset); - avio_flush(pb); size = avio_close_dyn_buf(pb, &buf); if (size < 0) diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index e75a34cb93..3d5b200099 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -415,7 +415,6 @@ void ff_rtp_send_punch_packets(URLContext *rtp_handle) avio_wb32(pb, 0); /* Timestamp */ avio_wb32(pb, 0); /* SSRC */ - avio_flush(pb); len = avio_close_dyn_buf(pb, &buf); if ((len > 0) && buf) ffurl_write(rtp_handle, buf, len); @@ -430,7 +429,6 @@ void ff_rtp_send_punch_packets(URLContext *rtp_handle) avio_wb16(pb, 1); /* length in words - 1 */ avio_wb32(pb, 0); /* our own SSRC */ - avio_flush(pb); len = avio_close_dyn_buf(pb, &buf); if ((len > 0) && buf) ffurl_write(rtp_handle, buf, len);