av_log: readd ffmpeg library runtime version mismatch warning

It just happens far too often.
This commit is contained in:
wm4 2016-05-01 20:11:15 +02:00
parent 622bcb0e37
commit 3ff3749b7d
1 changed files with 13 additions and 1 deletions

View File

@ -207,17 +207,29 @@ void print_libav_versions(struct mp_log *log, int v)
mp_msg(log, v, "%s library versions:\n", LIB_PREFIX);
bool mismatch = false;
for (int n = 0; n < MP_ARRAY_SIZE(libs); n++) {
const struct lib *l = &libs[n];
mp_msg(log, v, " %-15s %d.%d.%d", l->name, V(l->buildv));
if (l->buildv != l->runv)
if (l->buildv != l->runv) {
mp_msg(log, v, " (runtime %d.%d.%d)", V(l->runv));
mismatch = true;
}
mp_msg(log, v, "\n");
}
#if HAVE_AV_VERSION_INFO
mp_msg(log, v, "%s version: %s\n", LIB_PREFIX, av_version_info());
#endif
if (mismatch) {
// Using mismatched libraries can be legitimate, but even then it's
// a bad idea. We don't acknowledge its usefulness and stability.
mp_warn(log, "Warning: mpv was compiled against a different version of "
"%s than the shared\nlibrary it is linked against. This is "
"most likely a broken build\nand misbehavior and crashes are "
"to be expected.\n", LIB_PREFIX);
}
}
#undef V