From 0f1764195a8b818ecafed37841e4c48d9f4718da Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 14 Oct 2013 19:48:58 +0200 Subject: 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). --- mpvcore/av_log.c | 41 ++++++++++++++++++++++++++++------------- mpvcore/av_log.h | 2 +- mpvcore/mplayer.c | 6 ++++-- 3 files changed, 33 insertions(+), 16 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 #endif +#ifdef CONFIG_LIBAVRESAMPLE +#include +#endif +#ifdef CONFIG_LIBSWRESAMPLE +#include +#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 } diff --git a/mpvcore/av_log.h b/mpvcore/av_log.h index 833a7af03b..d5c57b0aeb 100644 --- a/mpvcore/av_log.h +++ b/mpvcore/av_log.h @@ -1,2 +1,2 @@ void init_libav(void); -void print_libav_versions(void); +void print_libav_versions(int v); diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index 1d4be97605..6800f84a7f 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -4822,8 +4822,11 @@ void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e) void mp_print_version(int always) { - mp_msg(MSGT_CPLAYER, always ? MSGL_INFO : MSGL_V, + int v = always ? MSGL_INFO : MSGL_V; + mp_msg(MSGT_CPLAYER, v, "%s (C) 2000-2013 mpv/MPlayer/mplayer2 projects\n built on %s\n", mplayer_version, mplayer_builddate); + print_libav_versions(v); + mp_msg(MSGT_CPLAYER, v, "\n"); } static bool handle_help_options(struct MPContext *mpctx) @@ -4950,7 +4953,6 @@ static int mpv_main(int argc, char *argv[]) m_config_preparse_command_line(mpctx->mconfig, argc, argv); mp_print_version(false); - print_libav_versions(); if (!parse_cfgfiles(mpctx, mpctx->mconfig)) exit_player(mpctx, EXIT_ERROR); -- cgit v1.2.3