aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-22 13:04:58 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-22 13:04:58 +0000
commit208749a0ddfcdb2bc040d7e1314ccd24c96b8a17 (patch)
tree85af3fd3b6f3dd346f8bb24776f62c622e9439b8
parent7eb185e0a3451b67cf798206bf3581ec96647da1 (diff)
downloadffmpeg-208749a0ddfcdb2bc040d7e1314ccd24c96b8a17.tar.gz
Increase flexibility of PRINT_LIB_VERSION(), make it accept a flags
parameter. Allow a pending factorization. Originally committed as revision 24431 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--cmdutils.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 4e8ab6d6d7..54b287cddc 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -301,27 +301,32 @@ void print_error(const char *filename, int err)
fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
}
-#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \
+#define INDENT 1
+#define SHOW_VERSION 2
+
+#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,flags) \
if (CONFIG_##LIBNAME) { \
+ if (flags & SHOW_VERSION) { \
unsigned int version = libname##_version(); \
fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n", \
- indent? " " : "", #libname, \
+ flags & INDENT? " " : "", #libname, \
LIB##LIBNAME##_VERSION_MAJOR, \
LIB##LIBNAME##_VERSION_MINOR, \
LIB##LIBNAME##_VERSION_MICRO, \
version >> 16, version >> 8 & 0xff, version & 0xff); \
- }
+ } \
+ } \
-static void print_all_lib_versions(FILE* outstream, int indent)
+static void print_all_lib_versions(FILE* outstream, int flags)
{
- PRINT_LIB_VERSION(outstream, avutil, AVUTIL, indent);
- PRINT_LIB_VERSION(outstream, avcore, AVCORE, indent);
- PRINT_LIB_VERSION(outstream, avcodec, AVCODEC, indent);
- PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent);
- PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, indent);
- PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent);
- PRINT_LIB_VERSION(outstream, swscale, SWSCALE, indent);
- PRINT_LIB_VERSION(outstream, postproc, POSTPROC, indent);
+ PRINT_LIB_VERSION(outstream, avutil, AVUTIL, flags);
+ PRINT_LIB_VERSION(outstream, avcore, AVCORE, flags);
+ PRINT_LIB_VERSION(outstream, avcodec, AVCODEC, flags);
+ PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, flags);
+ PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, flags);
+ PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, flags);
+ PRINT_LIB_VERSION(outstream, swscale, SWSCALE, flags);
+ PRINT_LIB_VERSION(outstream, postproc, POSTPROC, flags);
}
static void maybe_print_config(const char *lib, const char *cfg)
@@ -357,12 +362,12 @@ void show_banner(void)
PRINT_LIB_CONFIG(AVFILTER, "libavfilter", avfilter_configuration());
PRINT_LIB_CONFIG(SWSCALE, "libswscale", swscale_configuration());
PRINT_LIB_CONFIG(POSTPROC, "libpostproc", postproc_configuration());
- print_all_lib_versions(stderr, 1);
+ print_all_lib_versions(stderr, INDENT|SHOW_VERSION);
}
void show_version(void) {
printf("%s " FFMPEG_VERSION "\n", program_name);
- print_all_lib_versions(stdout, 0);
+ print_all_lib_versions(stdout, SHOW_VERSION);
}
void show_license(void)