summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-07-30 21:13:03 +0200
committerwm4 <wm4@nowhere>2012-07-30 22:14:33 +0200
commit261243496ef7a7e90c921f868411ddf8c71c1d83 (patch)
tree9f2e156fb47b7c2fd47b603a12a7ef79c3ad423e
parent7cdfd2ba39cd1a69139d9a2c3788aa8865e37e7d (diff)
downloadmpv-261243496ef7a7e90c921f868411ddf8c71c1d83.tar.bz2
mpv-261243496ef7a7e90c921f868411ddf8c71c1d83.tar.xz
configure: remove memalign check
Also, replace the only use of memalign: use av_malloc instead in sub.c. (av_malloc allocates with the required alignment restrictions.)
-rwxr-xr-xconfigure26
-rw-r--r--sub/sub.c8
2 files changed, 5 insertions, 29 deletions
diff --git a/configure b/configure
index 95acce4f47..b1f288be64 100755
--- a/configure
+++ b/configure
@@ -1724,28 +1724,6 @@ fi
echores "$_malloc"
-echocheck "memalign()"
-# XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
-def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
-_memalign=no
-statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
-if test "$_memalign" = yes ; then
- def_memalign='#define HAVE_MEMALIGN 1'
-else
- def_memalign='#define HAVE_MEMALIGN 0'
- def_map_memalign='#define memalign(a, b) malloc(b)'
- darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
-fi
-echores "$_memalign"
-
-
-echocheck "posix_memalign()"
-posix_memalign=no
-def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
-define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
- posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
-echores "$posix_memalign"
-
echocheck "alloca.h"
_alloca=no
@@ -4387,8 +4365,6 @@ $def_gettimeofday
$def_glob
$def_langinfo
$def_lrintf
-$def_map_memalign
-$def_memalign
$def_nanosleep
$def_posix_select
$def_select
@@ -4587,9 +4563,7 @@ $def_llrint
$def_log2
$def_log2f
$def_lrint
-$def_memalign_hack
$def_mkstemp
-$def_posix_memalign
$def_pthreads
$def_round
$def_roundf
diff --git a/sub/sub.c b/sub/sub.c
index 485550a470..21c8d03c67 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -20,6 +20,9 @@
#include <stdlib.h>
#include <string.h>
+#include <libavutil/mem.h>
+#include <libavutil/common.h>
+
#include "config.h"
#if HAVE_MALLOC_H
#include <malloc.h>
@@ -38,7 +41,6 @@
#include "libvo/video_out.h"
#include "sub.h"
#include "spudec.h"
-#include "libavutil/common.h"
char * const sub_osd_names[]={
@@ -140,8 +142,8 @@ void osd_alloc_buf(mp_osd_obj_t* obj)
obj->allocated = len;
free(obj->bitmap_buffer);
free(obj->alpha_buffer);
- obj->bitmap_buffer = memalign(16, len);
- obj->alpha_buffer = memalign(16, len);
+ obj->bitmap_buffer = av_malloc(len);
+ obj->alpha_buffer = av_malloc(len);
}
memset(obj->bitmap_buffer, sub_bg_color, len);
memset(obj->alpha_buffer, sub_bg_alpha, len);