From patchwork Wed Dec 23 11:23:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 24632 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 95C7F44A520 for ; Wed, 23 Dec 2020 13:24:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6817068AAC1; Wed, 23 Dec 2020 13:24:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C65968AA95 for ; Wed, 23 Dec 2020 13:23:58 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (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-202.mailbox.org (Postfix) with ESMTPS id 4D19nn5S6fzQlSn for ; Wed, 23 Dec 2020 12:23:57 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id MurTSDrKRTAN for ; Wed, 23 Dec 2020 12:23:54 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Wed, 23 Dec 2020 16:53:39 +0530 Message-Id: <20201223112339.1652-1-ffmpeg@gyani.pro> In-Reply-To: <20201223103349.ii63p2jsyg7zjc25@phare.normalesup.org> References: <20201223103349.ii63p2jsyg7zjc25@phare.normalesup.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.11 / 15.00 / 15.00 X-Rspamd-Queue-Id: C03FB171D X-Rspamd-UID: 9a7edd Subject: [FFmpeg-devel] [PATCH v2] ffmpeg: delay first 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" Wait for all output files to be initialized before printing first stats. Avoids breaking output file dump report. --- fftools/ffmpeg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 2c0820aacf..84a60f944a 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -136,6 +136,7 @@ static int nb_frames_dup = 0; static unsigned dup_warning = 1000; static int nb_frames_drop = 0; static int64_t decode_error_stat[2]; +static unsigned nb_output_dumped = 0; static int want_sdp = 1; @@ -1699,7 +1700,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti if (last_time == -1) { last_time = cur_time; } - if ((cur_time - last_time) < stats_period && !first_report) + if (((cur_time - last_time) < stats_period && !first_report) || + (first_report && nb_output_dumped < nb_output_files)) return; last_time = cur_time; } @@ -3017,6 +3019,7 @@ static int check_init_output_file(OutputFile *of, int file_index) of->header_written = 1; av_dump_format(of->ctx, file_index, of->ctx->url, 1); + nb_output_dumped++; if (sdp_filename || want_sdp) print_sdp();