[FFmpeg-devel] [PATCH 2/2] cmdutils: Do not display 'configuration:' when invoking ffmpeg if FFMPEG_CONFIGURATION exceeds 1000 characters.

Stephen Hutchinson qyot27 at gmail.com
Sat Aug 10 10:04:16 CEST 2013


1000 is a safe distance away from the actual limit of 1024. If it
hit 1024 previously, then two things would happen:

1) The 'configuration:' line gets truncated.

2) It collides with the library version info and throws off the
formatting.
---
 cmdutils.c | 5 ++++-
 ffmpeg.c   | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmdutils.c b/cmdutils.c
index fed8213..4faf5ad 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1063,7 +1063,10 @@ static void print_program_info(int flags, int level)
     av_log(NULL, level, "%sbuilt on %s %s with %s\n",
            indent, __DATE__, __TIME__, CC_IDENT);
 
-    av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
+    if (strlen(FFMPEG_CONFIGURATION) > 1000) {
+    } else {
+        av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
+    }
 }
 
 static void print_buildconf(int flags, int level)
diff --git a/ffmpeg.c b/ffmpeg.c
index cc709ab..ed00081 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3371,6 +3371,9 @@ int main(int argc, char **argv)
     if (nb_output_files <= 0 && nb_input_files == 0) {
         show_usage();
         av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name);
+        if (strlen(FFMPEG_CONFIGURATION) > 1000) {
+            av_log(NULL, AV_LOG_WARNING, "\nUse -buildconf to get info about how this build of %s was compiled.\n", program_name);
+        }
         exit_program(1);
     }
 
-- 
1.8.1.2



More information about the ffmpeg-devel mailing list