summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/filter/vf_fingerprint.c4
-rw-r--r--wscript6
2 files changed, 8 insertions, 2 deletions
diff --git a/video/filter/vf_fingerprint.c b/video/filter/vf_fingerprint.c
index 3fa2ed6770..9f511e168f 100644
--- a/video/filter/vf_fingerprint.c
+++ b/video/filter/vf_fingerprint.c
@@ -136,8 +136,8 @@ static void reinit_fmt(struct mp_filter *f, struct mp_image *mpi)
size_t tmp_size;
if (!zimg_filter_graph_get_tmp_size(p->zimg_graph, &tmp_size)) {
- if (posix_memalign(&p->zimg_tmp, ZIMG_ALIGN, tmp_size))
- p->zimg_tmp = NULL;
+ tmp_size = MP_ALIGN_UP(tmp_size, ZIMG_ALIGN);
+ p->zimg_tmp = aligned_alloc(ZIMG_ALIGN, tmp_size);
}
if (!p->zimg_tmp) {
diff --git a/wscript b/wscript
index bcd658e6e2..62ea9c2998 100644
--- a/wscript
+++ b/wscript
@@ -214,6 +214,11 @@ main_dependencies = [
'atomic_int_least64_t test = ATOMIC_VAR_INIT(123);'
'atomic_fetch_add(&test, 1)'))
}, {
+ # C11; technically we still support C99
+ 'name': 'aligned_alloc',
+ 'desc': 'C11 aligned_alloc()',
+ 'func': check_statement('stdlib.h', 'aligned_alloc(1, 1)'),
+ }, {
'name': 'atomics',
'desc': 'stdatomic.h support or slow emulation',
'func': check_true,
@@ -386,6 +391,7 @@ iconv support use --disable-iconv.",
'func': check_pkg_config('rubberband', '>= 1.8.0'),
}, {
'name': '--zimg',
+ 'deps': 'aligned_alloc',
'desc': 'libzimg support (for vf_fingerprint)',
'func': check_pkg_config('zimg', '>= 2.9'),
}, {