From patchwork Mon Apr 10 23:00:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 3358 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp1599668vss; Mon, 10 Apr 2017 16:00:34 -0700 (PDT) X-Received: by 10.223.130.212 with SMTP id 78mr10590744wrc.106.1491865234139; Mon, 10 Apr 2017 16:00:34 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 34si23120653wrr.193.2017.04.10.16.00.33; Mon, 10 Apr 2017 16:00:34 -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 ECED068925B; Tue, 11 Apr 2017 02:00:24 +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 F3B6C68925B for ; Tue, 11 Apr 2017 02:00:17 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 08A3610109F; Tue, 11 Apr 2017 01:00:23 +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 0ehscIN1xIEQ; Tue, 11 Apr 2017 01:00:20 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B602A100BDD; Tue, 11 Apr 2017 01:00:20 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Apr 2017 01:00:14 +0200 Message-Id: <20170410230014.7080-1-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 In-Reply-To: References: Subject: [FFmpeg-devel] [PATCHv2] ffprobe: only use custom logging callback if -show_log is set 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" The custom callback can cause significant CPU usage on Windows for some large files with many index entries for some reason. v2: Move check after parsing options. Signed-off-by: Marton Balint --- ffprobe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ffprobe.c b/ffprobe.c index 0a9ba14..72f5ed7 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -3458,8 +3458,6 @@ int main(int argc, char **argv) goto end; } #endif - av_log_set_callback(log_callback); - av_log_set_flags(AV_LOG_SKIP_REPEATED); register_exit(ffprobe_cleanup); @@ -3475,6 +3473,9 @@ int main(int argc, char **argv) show_banner(argc, argv, options); parse_options(NULL, argc, argv, options, opt_input_file); + if (do_show_log) + av_log_set_callback(log_callback); + /* mark things to show, based on -show_entries */ SET_DO_SHOW(CHAPTERS, chapters); SET_DO_SHOW(ERROR, error);