Browse code

ffprobe: only use custom logging callback if -show_log is set

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>

Marton Balint authored on 2017/04/06 03:17:48
Showing 1 changed files
... ...
@@ -3442,8 +3442,6 @@ int main(int argc, char **argv)
3442 3442
         goto end;
3443 3443
     }
3444 3444
 #endif
3445
-    av_log_set_callback(log_callback);
3446
-
3447 3445
     av_log_set_flags(AV_LOG_SKIP_REPEATED);
3448 3446
     register_exit(ffprobe_cleanup);
3449 3447
 
... ...
@@ -3459,6 +3457,9 @@ int main(int argc, char **argv)
3459 3459
     show_banner(argc, argv, options);
3460 3460
     parse_options(NULL, argc, argv, options, opt_input_file);
3461 3461
 
3462
+    if (do_show_log)
3463
+        av_log_set_callback(log_callback);
3464
+
3462 3465
     /* mark things to show, based on -show_entries */
3463 3466
     SET_DO_SHOW(CHAPTERS, chapters);
3464 3467
     SET_DO_SHOW(ERROR, error);