summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-10-01 20:03:49 +0300
committerUoti Urpala <uau@mplayer2.org>2011-10-01 20:03:49 +0300
commit377ae044e2044000477fe1adf3209c02638bacc7 (patch)
treef0a5ba74d56930678e83791f10be4b22369a4c4d
parentc9e681fca3a516899018cfde0b7ea964476b2107 (diff)
downloadmpv-377ae044e2044000477fe1adf3209c02638bacc7.tar.bz2
mpv-377ae044e2044000477fe1adf3209c02638bacc7.tar.xz
terminal output: show libav version numbers in verbose mode
-rw-r--r--av_log.c27
-rw-r--r--av_log.h1
-rw-r--r--mplayer.c1
3 files changed, 29 insertions, 0 deletions
diff --git a/av_log.c b/av_log.c
index d4684218ed..7c6307d274 100644
--- a/av_log.c
+++ b/av_log.c
@@ -26,11 +26,14 @@
#include "av_log.h"
#include "config.h"
#include "mp_msg.h"
+#include <libavutil/avutil.h>
#include <libavutil/log.h>
#ifdef CONFIG_FFMPEG
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
+#include <libswscale/swscale.h>
+#include <libpostproc/postprocess.h>
#endif
static int av_log_level_to_mp_level(int av_level)
@@ -119,3 +122,27 @@ void init_libav(void)
av_register_all();
#endif
}
+
+#define V(x) (x)>>16, (x)>>8 & 255, (x) & 255
+static void print_version(char *name, unsigned buildv, unsigned runv)
+{
+
+ if (buildv == runv)
+ mp_msg(MSGT_CPLAYER, MSGL_V, "Compiled against %s version %d.%d.%d\n",
+ name, V(buildv));
+ else
+ mp_msg(MSGT_CPLAYER, MSGL_V, "Compiled against %s version %d.%d.%d "
+ "(runtime %d.%d.%d)\n", name, V(buildv), V(runv));
+}
+#undef V
+
+void print_libav_versions(void)
+{
+ print_version("libavutil", LIBAVUTIL_VERSION_INT, avutil_version());
+#ifdef CONFIG_FFMPEG
+ print_version("libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version());
+ print_version("libavformat", LIBAVFORMAT_VERSION_INT, avformat_version());
+ print_version("libswscale", LIBSWSCALE_VERSION_INT, swscale_version());
+ print_version("libpostproc", LIBPOSTPROC_VERSION_INT, postproc_version());
+#endif
+}
diff --git a/av_log.h b/av_log.h
index 3bb3b1edbb..833a7af03b 100644
--- a/av_log.h
+++ b/av_log.h
@@ -1 +1,2 @@
void init_libav(void);
+void print_libav_versions(void);
diff --git a/mplayer.c b/mplayer.c
index d10de38602..ceb9f794a8 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3917,6 +3917,7 @@ static void print_version(const char *name)
mp_msg(MSGT_CPLAYER, MSGL_V, "\n");
#endif /* CONFIG_RUNTIME_CPUDETECT */
#endif /* ARCH_X86 */
+ print_libav_versions();
}
#ifdef PTW32_STATIC_LIB