diff options
author | wm4 <wm4@nowhere> | 2013-10-14 19:48:58 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-14 20:14:17 +0200 |
commit | 0f1764195a8b818ecafed37841e4c48d9f4718da (patch) | |
tree | d1981602258b77e5e903973e2d619eccd90134f7 /mpvcore/av_log.c | |
parent | 683da7411e6872de117cb36a6f175e8934b29d9e (diff) | |
download | mpv-0f1764195a8b818ecafed37841e4c48d9f4718da.tar.bz2 mpv-0f1764195a8b818ecafed37841e4c48d9f4718da.tar.xz |
mplayer: print ffmpeg library versions along with mpv version info
Also change what the FFmpeg version info looks like, and additionally
dump lavfi/lavr/lswr versions. (Don't bother with libavdevice and
libpostproc, they're not important enough.)
Unfortunately, there's no "single" FFmpeg/Libav version due to fatal
braindeath on the FFmpeg/Libav side. We can't map the versions to
releases either (it simply isn't accessible anywhere).
Diffstat (limited to 'mpvcore/av_log.c')
-rw-r--r-- | mpvcore/av_log.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/mpvcore/av_log.c b/mpvcore/av_log.c index c233984be9..9fa6fc93ae 100644 --- a/mpvcore/av_log.c +++ b/mpvcore/av_log.c @@ -41,6 +41,13 @@ #include <libavfilter/avfilter.h> #endif +#ifdef CONFIG_LIBAVRESAMPLE +#include <libavresample/avresample.h> +#endif +#ifdef CONFIG_LIBSWRESAMPLE +#include <libswresample/swresample.h> +#endif + static int av_log_level_to_mp_level(int av_level) { if (av_level > AV_LOG_VERBOSE) @@ -140,22 +147,30 @@ void init_libav(void) } #define V(x) (x)>>16, (x)>>8 & 255, (x) & 255 -static void print_version(char *name, unsigned buildv, unsigned runv) +static void print_version(int v, 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)); + mp_msg(MSGT_CPLAYER, v, " %-15s %d.%d.%d", name, V(buildv)); + if (buildv != runv) + mp_msg(MSGT_CPLAYER, v, " (runtime %d.%d.%d)", V(runv)); + mp_msg(MSGT_CPLAYER, v, "\n"); } #undef V -void print_libav_versions(void) +void print_libav_versions(int v) { - print_version("libavutil", LIBAVUTIL_VERSION_INT, avutil_version()); - print_version("libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version()); - print_version("libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()); - print_version("libswscale", LIBSWSCALE_VERSION_INT, swscale_version()); + mp_msg(MSGT_CPLAYER, v, "%s library versions:\n", LIB_PREFIX); + + print_version(v, "libavutil", LIBAVUTIL_VERSION_INT, avutil_version()); + print_version(v, "libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version()); + print_version(v, "libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()); + print_version(v, "libswscale", LIBSWSCALE_VERSION_INT, swscale_version()); +#ifdef CONFIG_LIBAVFILTER + print_version(v, "libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version()); +#endif +#ifdef CONFIG_LIBAVRESAMPLE + print_version(v, "libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version()); +#endif +#ifdef CONFIG_LIBSWRESAMPLE + print_version(v, "libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version()); +#endif } |