1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-02 21:12:23 +00:00

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).
This commit is contained in:
wm4 2013-10-14 19:48:58 +02:00
parent 683da7411e
commit 0f1764195a
3 changed files with 33 additions and 16 deletions

View File

@ -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
}

View File

@ -1,2 +1,2 @@
void init_libav(void);
void print_libav_versions(void);
void print_libav_versions(int v);

View File

@ -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);