diff mbox

[FFmpeg-devel,PATCHv2] ffprobe: only use custom logging callback if -show_log is set

Message ID 20170410230014.7080-1-cus@passwd.hu
State Accepted
Commit 1f9419753667beb6298d8d8b683211680abb4fe6
Headers show

Commit Message

Marton Balint April 10, 2017, 11 p.m. UTC
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 <cus@passwd.hu>
---
 ffprobe.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Marton Balint April 12, 2017, 7:17 p.m. UTC | #1
On Tue, 11 Apr 2017, Marton Balint wrote:

> 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 <cus@passwd.hu>
> ---

Applied.

Regards,
Marton
diff mbox

Patch

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);