diff options
author | wm4 <wm4@nowhere> | 2016-07-01 20:56:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-01 20:56:59 +0200 |
commit | d057e7a142a327c653f3f0379014567028448b5d (patch) | |
tree | 3bcc4dd515ac8bd5db975cfae12075bb3cb584be /player | |
parent | 3738bfb451c8558ed6f3710a72d418e7c68f7f5b (diff) | |
download | mpv-d057e7a142a327c653f3f0379014567028448b5d.tar.bz2 mpv-d057e7a142a327c653f3f0379014567028448b5d.tar.xz |
player: fatal error if linked and compiled FFmpeg versions mismatch
We don't support this anymore.
This tries to exit in a controlled way after command line options are
applied in order to honor logging options and, in case of libmpv, not to
kill the host. Not sure if it would be better to just vomit text to
stderr and call abort().
Diffstat (limited to 'player')
-rw-r--r-- | player/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c index 21c273338c..7c06b5fed0 100644 --- a/player/main.c +++ b/player/main.c @@ -418,6 +418,18 @@ int mp_initialize(struct MPContext *mpctx, char **options) if (handle_help_options(mpctx)) return -2; + if (!print_libav_versions(mp_null_log, 0)) { + // Using mismatched libraries can be legitimate, but even then it's + // a bad idea. We don't acknowledge its usefulness and stability. + print_libav_versions(mpctx->log, MSGL_FATAL); + MP_FATAL(mpctx, "\nmpv was compiled against a different version of " + "FFmpeg/Libav than the shared\nlibrary it is linked against. " + "This is most likely a broken build and could\nresult in " + "misbehavior and crashes.\n\nmpv does not support this" + "configuration and will not run - rebuild mpv instead.\n"); + return -1; + } + if (opts->dump_stats && opts->dump_stats[0]) { if (mp_msg_open_stats_file(mpctx->global, opts->dump_stats) < 0) MP_ERR(mpctx, "Failed to open stats file '%s'\n", opts->dump_stats); |