summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-03-08 18:54:01 +0100
committerwm4 <wm4@nowhere>2020-03-08 19:38:10 +0100
commit62c1d7972449f8ed0f8d5db895367fab26ab56ff (patch)
tree014fac7cccf87836ee5a3830485b402bd631c344 /common
parentd0d9ace421ea86c0642c57865c41248df1fe0b00 (diff)
downloadmpv-62c1d7972449f8ed0f8d5db895367fab26ab56ff.tar.bz2
mpv-62c1d7972449f8ed0f8d5db895367fab26ab56ff.tar.xz
player: rearrange libav* library check
No need to be nice. Also hopefully breaks idiotic distro patches.
Diffstat (limited to 'common')
-rw-r--r--common/av_log.c17
-rw-r--r--common/av_log.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/common/av_log.c b/common/av_log.c
index d7df24e05c..8122d3a65b 100644
--- a/common/av_log.c
+++ b/common/av_log.c
@@ -176,7 +176,7 @@ struct lib {
unsigned runv;
};
-bool print_libav_versions(struct mp_log *log, int v)
+void check_library_versions(struct mp_log *log, int v)
{
const struct lib libs[] = {
{"libavutil", LIBAVUTIL_VERSION_INT, avutil_version()},
@@ -189,21 +189,22 @@ bool print_libav_versions(struct mp_log *log, int v)
mp_msg(log, v, "FFmpeg library versions:\n");
- 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 = l->buildv > l->runv ||
- AV_VERSION_MAJOR(l->buildv) != AV_VERSION_MAJOR(l->runv);
- }
mp_msg(log, v, "\n");
+ if (l->buildv > l->runv ||
+ AV_VERSION_MAJOR(l->buildv) != AV_VERSION_MAJOR(l->runv))
+ {
+ fprintf(stderr, "%s: %d.%d.%d -> %d.%d.%d\n",
+ l->name, V(l->buildv), V(l->runv));
+ abort();
+ }
}
mp_msg(log, v, "FFmpeg version: %s\n", av_version_info());
-
- return !mismatch;
}
#undef V
diff --git a/common/av_log.h b/common/av_log.h
index 18f7fc9d82..ae12838c35 100644
--- a/common/av_log.h
+++ b/common/av_log.h
@@ -7,5 +7,5 @@ struct mpv_global;
struct mp_log;
void init_libav(struct mpv_global *global);
void uninit_libav(struct mpv_global *global);
-bool print_libav_versions(struct mp_log *log, int v);
+void check_library_versions(struct mp_log *log, int v);
#endif