From patchwork Mon Dec 21 09:21:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 24606 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D87964492C0 for ; Mon, 21 Dec 2020 11:21:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AFE4F68ACFE; Mon, 21 Dec 2020 11:21:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9674C68ABB4 for ; Mon, 21 Dec 2020 11:21:43 +0200 (EET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Czv9f3jRDzQlWr for ; Mon, 21 Dec 2020 10:21:42 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id e0oIGfPFZ91g for ; Mon, 21 Dec 2020 10:21:39 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Dec 2020 14:51:21 +0530 Message-Id: <20201221092122.1658-2-ffmpeg@gyani.pro> In-Reply-To: <20201221092122.1658-1-ffmpeg@gyani.pro> References: <20201221092122.1658-1-ffmpeg@gyani.pro> MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.18 / 15.00 / 15.00 X-Rspamd-Queue-Id: 8CFFC1843 X-Rspamd-UID: 63a17f Subject: [FFmpeg-devel] [PATCH 2/2] ffmpeg: don't delay printing initial stats 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The first stats is printed after the initial stats_period has elapsed. With a large period, it may appear that ffmpeg has frozen at startup. The initial stats is now printed after the first transcode_step. --- fftools/ffmpeg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 6d25f1bca9..2c0820aacf 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1685,6 +1685,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti double speed; int64_t pts = INT64_MIN + 1; static int64_t last_time = -1; + static int first_report = 1; static int qp_histogram[52]; int hours, mins, secs, us; const char *hours_sign; @@ -1697,9 +1698,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti if (!is_last_report) { if (last_time == -1) { last_time = cur_time; - return; } - if ((cur_time - last_time) < stats_period) + if ((cur_time - last_time) < stats_period && !first_report) return; last_time = cur_time; } @@ -1876,6 +1876,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti } } + first_report = 0; + if (is_last_report) print_final_stats(total_size); }