From: Gildas Bazin Date: Fri, 5 Apr 2002 01:05:22 +0000 (+0000) Subject: * introduced a memalign wrapper that will align the memory manually if X-Git-Tag: 0.3.0~9 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=cf5b3832dc6ad3fb4e55e9506e7e803d3e26ed53;p=vlc * introduced a memalign wrapper that will align the memory manually if memalign doesn't exist. void *vlc_memalign( size_t align, size_t size, void **pp_orig ) where the return value is the aligned pointer and *pp_orig is the pointer that has to be freed afterwards. the arithmetic I'm doing on the pointer to align it is not portable to 64bits architectures. If someone knows how to something portable, please tell me ( and no I don't want to do if(sizeof(void *) == blabla) ). Other little problem, I was planning to use posix_memalign by default in the wrapper implementation but it doesn't work (someone can tell me what I'm doing wrong ?) * re-enabled the sse plugins on win32 as we don't have anymore alignment issues. * fixed typo in vout_directx.c --- diff --git a/configure b/configure index 72d1a1e11e..6535dc703e 100755 --- a/configure +++ b/configure @@ -3183,7 +3183,7 @@ fi ;; esac -for ac_func in gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign valloc +for ac_func in gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:3190: checking for $ac_func" >&5 @@ -5288,25 +5288,23 @@ PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http i MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx" MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext" THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn" -if test x$SYS != xmingw32; then - SSE_MODULES="imdctsse downmixsse" -fi +SSE_MODULES="imdctsse downmixsse" ALTIVEC_MODULES="idctaltivec motionaltivec" echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6 -echo "configure:5298: checking if \$CC groks MMX inline assembly" >&5 +echo "configure:5296: checking if \$CC groks MMX inline assembly" >&5 if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mmx_inline=yes else @@ -5324,19 +5322,19 @@ if test x"$ac_cv_mmx_inline" != x"no"; then fi echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6 -echo "configure:5328: checking if \$CC groks MMX EXT inline assembly" >&5 +echo "configure:5326: checking if \$CC groks MMX EXT inline assembly" >&5 if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mmxext_inline=yes else @@ -5354,19 +5352,19 @@ if test x"$ac_cv_mmxext_inline" != x"no"; then fi echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6 -echo "configure:5358: checking if \$CC groks 3D Now! inline assembly" >&5 +echo "configure:5356: checking if \$CC groks 3D Now! inline assembly" >&5 if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_3dnow_inline=yes else @@ -5388,19 +5386,19 @@ EOF fi echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6 -echo "configure:5392: checking if \$CC groks SSE inline assembly" >&5 +echo "configure:5390: checking if \$CC groks SSE inline assembly" >&5 if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sse_inline=yes else @@ -5425,19 +5423,19 @@ fi # we should be able to remove this test with future versions of mingw32 if test x$SYS != xmingw32; then echo $ac_n "checking if \$CC groks Altivec inline assembly""... $ac_c" 1>&6 -echo "configure:5429: checking if \$CC groks Altivec inline assembly" >&5 +echo "configure:5427: checking if \$CC groks Altivec inline assembly" >&5 if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_altivec_inline=yes else @@ -5447,14 +5445,14 @@ else save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wa,-m7400" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_altivec_inline="-Wa,-m7400" else @@ -5486,7 +5484,7 @@ EOF fi echo $ac_n "checking if \$CC groks Altivec C extensions""... $ac_c" 1>&6 -echo "configure:5490: checking if \$CC groks Altivec C extensions" >&5 +echo "configure:5488: checking if \$CC groks Altivec C extensions" >&5 if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5494,14 +5492,14 @@ else CFLAGS="$CFLAGS -faltivec" # Darwin test cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_altivec=-faltivec else @@ -5512,14 +5510,14 @@ else # Linux/PPC test CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_altivec="-fvec" else @@ -5550,21 +5548,21 @@ EOF fi echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6 -echo "configure:5554: checking if linker needs -framework vecLib" >&5 +echo "configure:5552: checking if linker needs -framework vecLib" >&5 if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -framework vecLib" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_ld_altivec=yes else @@ -5695,17 +5693,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5699: checking for $ac_hdr" >&5 +echo "configure:5697: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5736,7 +5734,7 @@ done else echo $ac_n "checking for libdvdcss.a in ${with_dvdcss_tree}""... $ac_c" 1>&6 -echo "configure:5740: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5 +echo "configure:5738: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`" if test "x$real_dvdcss_tree" = x then @@ -5762,7 +5760,7 @@ echo "configure:5740: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5 ;; *) echo $ac_n "checking for dvdcss headers in ${with_dvdcss}""... $ac_c" 1>&6 -echo "configure:5766: checking for dvdcss headers in ${with_dvdcss}" >&5 +echo "configure:5764: checking for dvdcss headers in ${with_dvdcss}" >&5 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h then echo "$ac_t""yes" 1>&6 @@ -5797,17 +5795,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5801: checking for $ac_hdr" >&5 +echo "configure:5799: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5837,7 +5835,7 @@ done ;; *) echo $ac_n "checking for dvdread headers in ${withval}""... $ac_c" 1>&6 -echo "configure:5841: checking for dvdread headers in ${withval}" >&5 +echo "configure:5839: checking for dvdread headers in ${withval}" >&5 if test -f ${withval}/include/dvdread/dvd_reader.h then echo "$ac_t""yes" 1>&6 @@ -5862,7 +5860,7 @@ fi if test x$enable_vcd != xno then cat > conftest.$ac_ext < EOF @@ -5903,12 +5901,12 @@ fi echo $ac_n "checking for inet_pton""... $ac_c" 1>&6 -echo "configure:5907: checking for inet_pton" >&5 +echo "configure:5905: checking for inet_pton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_pton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_pton=yes" else @@ -5987,17 +5985,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5991: checking for $ac_hdr" >&5 +echo "configure:5989: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6027,7 +6025,7 @@ fi done echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6 -echo "configure:6031: checking for mad_bit_init in -lmad" >&5 +echo "configure:6029: checking for mad_bit_init in -lmad" >&5 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6035,7 +6033,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmad $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6098,17 +6096,17 @@ if test "x$enableval" != "xno" -a x$SYS != xmingw32 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6102: checking for $ac_hdr" >&5 +echo "configure:6100: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6151,17 +6149,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6155: checking for $ac_hdr" >&5 +echo "configure:6153: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6220,17 +6218,17 @@ if test x$enable_x11 != xno && do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6224: checking for $ac_hdr" >&5 +echo "configure:6222: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6283,17 +6281,17 @@ if test x$enable_xvideo != xno && do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6287: checking for $ac_hdr" >&5 +echo "configure:6285: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6317,7 +6315,7 @@ EOF saved_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext" echo $ac_n "checking for XvSetPortAttribute in -lXv_pic""... $ac_c" 1>&6 -echo "configure:6321: checking for XvSetPortAttribute in -lXv_pic" >&5 +echo "configure:6319: checking for XvSetPortAttribute in -lXv_pic" >&5 ac_lib_var=`echo Xv_pic'_'XvSetPortAttribute | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6325,7 +6323,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXv_pic $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6394,7 +6392,7 @@ fi # Extract the first word of "sdl12-config", so it can be a program name with args. set dummy sdl12-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6398: checking for $ac_word" >&5 +echo "configure:6396: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6434,7 +6432,7 @@ fi # Extract the first word of "sdl11-config", so it can be a program name with args. set dummy sdl11-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6438: checking for $ac_word" >&5 +echo "configure:6436: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6475,7 +6473,7 @@ fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6479: checking for $ac_word" >&5 +echo "configure:6477: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6521,17 +6519,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6525: checking for $ac_hdr" >&5 +echo "configure:6523: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6601,17 +6599,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6605: checking for $ac_hdr" >&5 +echo "configure:6603: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6640,7 +6638,7 @@ done else echo $ac_n "checking for directX headers in ${withval}""... $ac_c" 1>&6 -echo "configure:6644: checking for directX headers in ${withval}" >&5 +echo "configure:6642: checking for directX headers in ${withval}" >&5 if test -f ${withval}/ddraw.h then PLUGINS="${PLUGINS} directx" @@ -6667,17 +6665,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6671: checking for $ac_hdr" >&5 +echo "configure:6669: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6772,17 +6770,17 @@ if test x$enable_aa = xyes then ac_safe=`echo "aalib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for aalib.h""... $ac_c" 1>&6 -echo "configure:6776: checking for aalib.h" >&5 +echo "configure:6774: checking for aalib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6833,17 +6831,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6837: checking for $ac_hdr" >&5 +echo "configure:6835: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6866,7 +6864,7 @@ EOF PLUGINS="${PLUGINS} dsp" echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6 -echo "configure:6870: checking for main in -lossaudio" >&5 +echo "configure:6868: checking for main in -lossaudio" >&5 ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6874,14 +6872,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lossaudio $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6917,7 +6915,7 @@ if test "${enable_esd+set}" = set; then # Extract the first word of "esd-config", so it can be a program name with args. set dummy esd-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6921: checking for $ac_word" >&5 +echo "configure:6919: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6968,7 +6966,7 @@ if test "${enable_arts+set}" = set; then # Extract the first word of "artsc-config", so it can be a program name with args. set dummy artsc-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6972: checking for $ac_word" >&5 +echo "configure:6970: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7018,17 +7016,17 @@ if test "${enable_alsa+set}" = set; then then ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6 -echo "configure:7022: checking for alsa/asoundlib.h" >&5 +echo "configure:7020: checking for alsa/asoundlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7045,7 +7043,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 -echo "configure:7049: checking for main in -lasound" >&5 +echo "configure:7047: checking for main in -lasound" >&5 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7053,14 +7051,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lasound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7137,7 +7135,7 @@ fi # Extract the first word of "gtk12-config", so it can be a program name with args. set dummy gtk12-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7141: checking for $ac_word" >&5 +echo "configure:7139: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7176,7 +7174,7 @@ fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7180: checking for $ac_word" >&5 +echo "configure:7178: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7226,17 +7224,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7230: checking for $ac_hdr" >&5 +echo "configure:7228: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7282,7 +7280,7 @@ if test "${enable_gnome+set}" = set; then # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7286: checking for $ac_word" >&5 +echo "configure:7284: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7327,17 +7325,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7331: checking for $ac_hdr" >&5 +echo "configure:7329: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7427,17 +7425,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7431: checking for $ac_hdr" >&5 +echo "configure:7429: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7482,17 +7480,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7486: checking for $ac_hdr" >&5 +echo "configure:7484: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7553,17 +7551,17 @@ if test x$enable_lirc = xyes then ac_safe=`echo "lirc/lirc_client.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for lirc/lirc_client.h""... $ac_c" 1>&6 -echo "configure:7557: checking for lirc/lirc_client.h" >&5 +echo "configure:7555: checking for lirc/lirc_client.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7580,7 +7578,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6 -echo "configure:7584: checking for lirc_init in -llirc_client" >&5 +echo "configure:7582: checking for lirc_init in -llirc_client" >&5 ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7588,7 +7586,7 @@ else ac_save_LIBS="$LIBS" LIBS="-llirc_client $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7656,7 +7654,7 @@ fi ;; *) echo $ac_n "checking whether the byte order is big-endian""... $ac_c" 1>&6 -echo "configure:7660: checking whether the byte order is big-endian" >&5 +echo "configure:7658: checking whether the byte order is big-endian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7741,7 +7739,7 @@ if test "${enable_pth+set}" = set; then enableval="$enable_pth" if test x$enableval = xyes; then echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6 -echo "configure:7745: checking for pth_init in -lpth" >&5 +echo "configure:7743: checking for pth_init in -lpth" >&5 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7749,7 +7747,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpth $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7788,7 +7786,7 @@ else fi cat > conftest.$ac_ext < EOF @@ -7814,7 +7812,7 @@ if test "${enable_st+set}" = set; then enableval="$enable_st" if test x$enableval = xyes; then echo $ac_n "checking for st_init in -lst""... $ac_c" 1>&6 -echo "configure:7818: checking for st_init in -lst" >&5 +echo "configure:7816: checking for st_init in -lst" >&5 ac_lib_var=`echo st'_'st_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7822,7 +7820,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lst $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7861,7 +7859,7 @@ else fi cat > conftest.$ac_ext < EOF diff --git a/configure.in b/configure.in index f2c562a32f..4bd159ef81 100644 --- a/configure.in +++ b/configure.in @@ -88,7 +88,7 @@ case x"${target_os}" in esac dnl Check for system libs needed -AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign valloc) +AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign) AC_CHECK_FUNC(connect,,[ AC_CHECK_LIB(socket,connect, @@ -377,9 +377,7 @@ dnl MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx" MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext" THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn" -if test x$SYS != xmingw32; then - SSE_MODULES="imdctsse downmixsse" -fi +SSE_MODULES="imdctsse downmixsse" ALTIVEC_MODULES="idctaltivec motionaltivec" AC_CACHE_CHECK([if \$CC groks MMX inline assembly], diff --git a/include/ac3_imdct.h b/include/ac3_imdct.h index 877b05745b..cbc8a44c20 100644 --- a/include/ac3_imdct.h +++ b/include/ac3_imdct.h @@ -2,7 +2,7 @@ * ac3_imdct.h : AC3 IMDCT types ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: ac3_imdct.h,v 1.6 2001/10/30 19:34:53 reno Exp $ + * $Id: ac3_imdct.h,v 1.7 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Michel Kaempf * Renaud Dartus @@ -32,26 +32,41 @@ typedef struct complex_s { typedef struct imdct_s { complex_t * buf; + void * buf_orig; /* pointer before memalign */ /* Delay buffer for time domain interleaving */ float * delay; + void * delay_orig; /* pointer before memalign */ float * delay1; + void * delay1_orig; /* pointer before memalign */ /* Twiddle factors for IMDCT */ float * xcos1; + void * xcos1_orig; /* pointer before memalign */ float * xsin1; + void * xsin1_orig; /* pointer before memalign */ float * xcos2; + void * xcos2_orig; /* pointer before memalign */ float * xsin2; + void * xsin2_orig; /* pointer before memalign */ float * xcos_sin_sse; + void * xcos_sin_sse_orig; /* pointer before memalign */ /* Twiddle factor LUT */ complex_t * w_2; + void * w_2_orig; /* pointer before memalign */ complex_t * w_4; + void * w_4_orig; /* pointer before memalign */ complex_t * w_8; + void * w_8_orig; /* pointer before memalign */ complex_t * w_16; + void * w_16_orig; /* pointer before memalign */ complex_t * w_32; + void * w_32_orig; /* pointer before memalign */ complex_t * w_64; + void * w_64_orig; /* pointer before memalign */ complex_t * w_1; + void * w_1_orig; /* pointer before memalign */ /* Module used and shortcuts */ struct module_s * p_module; diff --git a/include/common.h b/include/common.h index e38142f483..fea4bf7513 100644 --- a/include/common.h +++ b/include/common.h @@ -3,7 +3,7 @@ * Collection of useful common types and macros definitions ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: common.h,v 1.91 2002/04/02 23:43:57 gbazin Exp $ + * $Id: common.h,v 1.92 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -357,21 +357,33 @@ struct intf_subscription_s; # define ATTR_ALIGN(align) #endif -/* Alignment of critical dynamic data structure */ +/* Alignment of critical dynamic data structure + * + * Not all platforms support memalign so we provide a vlc_memalign wrapper + * void *vlc_memalign( size_t align, size_t size, void **pp_orig ) + * *pp_orig is the pointer that has to be freed afterwards. + */ +#if 0 +#ifdef HAVE_POSIX_MEMALIGN +# define vlc_memalign(align,size,pp_orig) \ + ( !posix_memalign( pp_orig, align, size ) ? *(pp_orig) : NULL ) +#endif +#endif #ifdef HAVE_MEMALIGN /* Some systems have memalign() but no declaration for it */ void * memalign( size_t align, size_t size ); -#else -# ifdef HAVE_VALLOC - /* That's like using a hammer to kill a fly, but eh... */ -# include -# define memalign(align,size) valloc(size) -# else - /* Assume malloc alignment is sufficient */ -# define memalign(align,size) malloc(size) -# endif + +# define vlc_memalign(align,size,pp_orig) \ + ( *(pp_orig) = memalign( align, size ) ) + +#else /* We don't have any choice but to align manually */ +# define vlc_memalign(align,size,pp_orig) \ + (( *(pp_orig) = malloc( size + align - 1 )) ? \ + (void *)( (((unsigned long)*(pp_orig)) + 15) & ~0xFUL ) : NULL ) + #endif + #define I64C(x) x##LL diff --git a/include/defs.h.in b/include/defs.h.in index a356d7661b..a3d1ba7565 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -1,4 +1,4 @@ -/* include/defs.h.in. Generated automatically from configure.in by autoheader. */ +/* include/defs.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if using alloca.c. */ #undef C_ALLOCA @@ -100,6 +100,9 @@ /* Define if you have the munmap function. */ #undef HAVE_MUNMAP +/* Define if you have the posix_memalign function. */ +#undef HAVE_POSIX_MEMALIGN + /* Define if you have the putenv function. */ #undef HAVE_PUTENV @@ -148,9 +151,6 @@ /* Define if you have the usleep function. */ #undef HAVE_USLEEP -/* Define if you have the valloc function. */ -#undef HAVE_VALLOC - /* Define if you have the vasprintf function. */ #undef HAVE_VASPRINTF diff --git a/include/vdec_ext-plugins.h b/include/vdec_ext-plugins.h index 3b72d5995e..710ac54726 100644 --- a/include/vdec_ext-plugins.h +++ b/include/vdec_ext-plugins.h @@ -2,7 +2,7 @@ * vdec_ext-plugins.h : structures from the video decoder exported to plug-ins ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vdec_ext-plugins.h,v 1.9 2002/01/04 14:01:34 sam Exp $ + * $Id: vdec_ext-plugins.h,v 1.10 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Christophe Massiot * @@ -29,6 +29,7 @@ typedef struct idct_inner_s { /* Should be kept aligned ! */ dctelem_t * pi_block; /* block */ + void * pi_block_orig; /* pointer before memalign */ void ( * pf_idct ) ( dctelem_t *, yuv_data_t *, int, void *, int ); /* sparse IDCT or not, add or copy ? */ diff --git a/include/video.h b/include/video.h index 88253dec0a..958369731f 100644 --- a/include/video.h +++ b/include/video.h @@ -4,7 +4,7 @@ * includes all common video types and constants. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video.h,v 1.47 2002/03/17 17:00:38 sam Exp $ + * $Id: video.h,v 1.48 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Vincent Seguin * @@ -60,6 +60,7 @@ typedef struct picture_s * NEVER be modified. A direct buffer can be handled as the plugin * wishes, it can even swap p_pixels buffers. */ u8 *p_data; + void *p_data_orig; /* pointer before memalign */ plane_t p[ VOUT_MAX_PLANES ]; /* description of the planes */ int i_planes; /* number of allocated planes */ @@ -351,6 +352,7 @@ typedef struct subpicture_s /* Private data - the subtitle plugin might want to put stuff here to * keep track of the subpicture */ struct subpicture_sys_s *p_sys; /* subpicture data */ + void *p_sys_orig; /* pointer before memalign */ } subpicture_t; diff --git a/plugins/ac3_adec/ac3_adec.c b/plugins/ac3_adec/ac3_adec.c index 931fa411b3..77ab02b7da 100644 --- a/plugins/ac3_adec/ac3_adec.c +++ b/plugins/ac3_adec/ac3_adec.c @@ -2,7 +2,7 @@ * ac3_adec.c: ac3 decoder module main file ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: ac3_adec.c,v 1.23 2002/03/12 18:37:46 stef Exp $ + * $Id: ac3_adec.c,v 1.24 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Michel Lespinasse * @@ -119,7 +119,8 @@ static int InitThread( ac3dec_thread_t * p_ac3thread ) * Thread properties */ p_ac3thread->p_fifo = p_ac3thread->p_config->p_decoder_fifo; - p_ac3thread->ac3_decoder = memalign( 16, sizeof(ac3dec_t) ); + p_ac3thread->ac3_decoder = + vlc_memalign( 16, sizeof(ac3dec_t), &p_ac3thread->ac3_decoder_orig ); /* * Choose the best downmix module @@ -133,7 +134,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread ) if( DOWNMIX.p_module == NULL ) { intf_ErrMsg( "ac3dec error: no suitable downmix module" ); - free( p_ac3thread->ac3_decoder ); + free( p_ac3thread->ac3_decoder_orig ); return( -1 ); } @@ -151,7 +152,8 @@ static int InitThread( ac3dec_thread_t * p_ac3thread ) /* * Choose the best IMDCT module */ - p_ac3thread->ac3_decoder->imdct = memalign(16, sizeof(imdct_t)); + p_ac3thread->ac3_decoder->imdct = + vlc_memalign( 16, sizeof(imdct_t), &p_ac3thread->ac3_decoder->imdct_orig ); #define IMDCT p_ac3thread->ac3_decoder->imdct psz_name = config_GetPszVariable( IMDCT_METHOD_VAR ); @@ -163,8 +165,8 @@ static int InitThread( ac3dec_thread_t * p_ac3thread ) { intf_ErrMsg( "ac3dec error: no suitable IMDCT module" ); module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module ); - free( p_ac3thread->ac3_decoder->imdct ); - free( p_ac3thread->ac3_decoder ); + free( p_ac3thread->ac3_decoder->imdct_orig ); + free( p_ac3thread->ac3_decoder_orig ); return( -1 ); } @@ -177,23 +179,40 @@ static int InitThread( ac3dec_thread_t * p_ac3thread ) #undef F /* Initialize the ac3 decoder structures */ - p_ac3thread->ac3_decoder->samples = memalign( 16, 6 * 256 * sizeof(float) ); - - IMDCT->buf = memalign( 16, N/4 * sizeof(complex_t) ); - IMDCT->delay = memalign( 16, 6 * 256 * sizeof(float) ); - IMDCT->delay1 = memalign( 16, 6 * 256 * sizeof(float) ); - IMDCT->xcos1 = memalign( 16, N/4 * sizeof(float) ); - IMDCT->xsin1 = memalign( 16, N/4 * sizeof(float) ); - IMDCT->xcos2 = memalign( 16, N/8 * sizeof(float) ); - IMDCT->xsin2 = memalign( 16, N/8 * sizeof(float) ); - IMDCT->xcos_sin_sse = memalign( 16, 128 * 4 * sizeof(float) ); - IMDCT->w_1 = memalign( 16, 1 * sizeof(complex_t) ); - IMDCT->w_2 = memalign( 16, 2 * sizeof(complex_t) ); - IMDCT->w_4 = memalign( 16, 4 * sizeof(complex_t) ); - IMDCT->w_8 = memalign( 16, 8 * sizeof(complex_t) ); - IMDCT->w_16 = memalign( 16, 16 * sizeof(complex_t) ); - IMDCT->w_32 = memalign( 16, 32 * sizeof(complex_t) ); - IMDCT->w_64 = memalign( 16, 64 * sizeof(complex_t) ); + p_ac3thread->ac3_decoder->samples = + vlc_memalign( 16, 6 * 256 * sizeof(float), + &p_ac3thread->ac3_decoder->samples_orig ); + + IMDCT->buf = vlc_memalign( 16, N/4 * sizeof(complex_t), + &IMDCT->buf_orig ); + IMDCT->delay = vlc_memalign( 16, 6 * 256 * sizeof(float), + &IMDCT->delay_orig ); + IMDCT->delay1 = vlc_memalign( 16, 6 * 256 * sizeof(float), + &IMDCT->delay1_orig ); + IMDCT->xcos1 = vlc_memalign( 16, N/4 * sizeof(float), + &IMDCT->xcos1_orig ); + IMDCT->xsin1 = vlc_memalign( 16, N/4 * sizeof(float), + &IMDCT->xsin1_orig ); + IMDCT->xcos2 = vlc_memalign( 16, N/8 * sizeof(float), + &IMDCT->xcos2_orig ); + IMDCT->xsin2 = vlc_memalign( 16, N/8 * sizeof(float), + &IMDCT->xsin2_orig ); + IMDCT->xcos_sin_sse = vlc_memalign( 16, 128 * 4 * sizeof(float), + &IMDCT->xcos_sin_sse_orig ); + IMDCT->w_1 = vlc_memalign( 16, 1 * sizeof(complex_t), + &IMDCT->w_1_orig ); + IMDCT->w_2 = vlc_memalign( 16, 2 * sizeof(complex_t), + &IMDCT->w_2_orig ); + IMDCT->w_4 = vlc_memalign( 16, 4 * sizeof(complex_t), + &IMDCT->w_4_orig ); + IMDCT->w_8 = vlc_memalign( 16, 8 * sizeof(complex_t), + &IMDCT->w_8_orig ); + IMDCT->w_16 = vlc_memalign( 16, 16 * sizeof(complex_t), + &IMDCT->w_16_orig ); + IMDCT->w_32 = vlc_memalign( 16, 32 * sizeof(complex_t), + &IMDCT->w_32_orig ); + IMDCT->w_64 = vlc_memalign( 16, 64 * sizeof(complex_t), + &IMDCT->w_64_orig ); ac3_init( p_ac3thread->ac3_decoder ); @@ -218,10 +237,12 @@ static int InitThread( ac3dec_thread_t * p_ac3thread ) static int decoder_Run ( decoder_config_t * p_config ) { ac3dec_thread_t * p_ac3thread; + void * p_ac3thread_orig; /* pointer before memalign */ boolean_t b_sync = 0; /* Allocate the memory needed to store the thread's structure */ - p_ac3thread = (ac3dec_thread_t *)memalign(16, sizeof(ac3dec_thread_t)); + p_ac3thread = (ac3dec_thread_t *)vlc_memalign( 16, + sizeof(ac3dec_thread_t), &p_ac3thread_orig ); if( p_ac3thread == NULL ) { @@ -239,7 +260,7 @@ static int decoder_Run ( decoder_config_t * p_config ) { intf_ErrMsg( "ac3_adec error: could not initialize thread" ); DecoderError( p_config->p_decoder_fifo ); - free( p_ac3thread ); + free( p_ac3thread_orig ); return( -1 ); } @@ -298,30 +319,30 @@ static int decoder_Run ( decoder_config_t * p_config ) sync_info.sample_rate, AC3DEC_FRAME_SIZE, NULL ); if ( p_ac3thread->p_aout_fifo == NULL ) { - free( IMDCT->w_1 ); - free( IMDCT->w_64 ); - free( IMDCT->w_32 ); - free( IMDCT->w_16 ); - free( IMDCT->w_8 ); - free( IMDCT->w_4 ); - free( IMDCT->w_2 ); - free( IMDCT->xcos_sin_sse ); - free( IMDCT->xsin2 ); - free( IMDCT->xcos2 ); - free( IMDCT->xsin1 ); - free( IMDCT->xcos1 ); - free( IMDCT->delay1 ); - free( IMDCT->delay ); - free( IMDCT->buf ); + free( IMDCT->w_1_orig ); + free( IMDCT->w_64_orig ); + free( IMDCT->w_32_orig ); + free( IMDCT->w_16_orig ); + free( IMDCT->w_8_orig ); + free( IMDCT->w_4_orig ); + free( IMDCT->w_2_orig ); + free( IMDCT->xcos_sin_sse_orig ); + free( IMDCT->xsin2_orig ); + free( IMDCT->xcos2_orig ); + free( IMDCT->xsin1_orig ); + free( IMDCT->xcos1_orig ); + free( IMDCT->delay1_orig ); + free( IMDCT->delay_orig ); + free( IMDCT->buf_orig ); #undef IMDCT - free( p_ac3thread->ac3_decoder->samples ); + free( p_ac3thread->ac3_decoder->samples_orig ); module_Unneed( p_ac3thread->ac3_decoder->imdct->p_module ); module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module ); - free( p_ac3thread->ac3_decoder->imdct ); - free( p_ac3thread->ac3_decoder ); + free( p_ac3thread->ac3_decoder->imdct_orig ); + free( p_ac3thread->ac3_decoder_orig ); return( -1 ); } @@ -364,7 +385,7 @@ static int decoder_Run ( decoder_config_t * p_config ) /* End of the ac3 decoder thread */ EndThread (p_ac3thread); - free( p_ac3thread ); + free( p_ac3thread_orig ); return( 0 ); } @@ -388,32 +409,32 @@ static void EndThread (ac3dec_thread_t * p_ac3thread) /* Free allocated structures */ #define IMDCT p_ac3thread->ac3_decoder->imdct - free( IMDCT->w_1 ); - free( IMDCT->w_64 ); - free( IMDCT->w_32 ); - free( IMDCT->w_16 ); - free( IMDCT->w_8 ); - free( IMDCT->w_4 ); - free( IMDCT->w_2 ); - free( IMDCT->xcos_sin_sse ); - free( IMDCT->xsin2 ); - free( IMDCT->xcos2 ); - free( IMDCT->xsin1 ); - free( IMDCT->xcos1 ); - free( IMDCT->delay1 ); - free( IMDCT->delay ); - free( IMDCT->buf ); + free( IMDCT->w_1_orig ); + free( IMDCT->w_64_orig ); + free( IMDCT->w_32_orig ); + free( IMDCT->w_16_orig ); + free( IMDCT->w_8_orig ); + free( IMDCT->w_4_orig ); + free( IMDCT->w_2_orig ); + free( IMDCT->xcos_sin_sse_orig ); + free( IMDCT->xsin2_orig ); + free( IMDCT->xcos2_orig ); + free( IMDCT->xsin1_orig ); + free( IMDCT->xcos1_orig ); + free( IMDCT->delay1_orig ); + free( IMDCT->delay_orig ); + free( IMDCT->buf_orig ); #undef IMDCT - free( p_ac3thread->ac3_decoder->samples ); + free( p_ac3thread->ac3_decoder->samples_orig ); /* Unlock the modules */ module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module ); module_Unneed( p_ac3thread->ac3_decoder->imdct->p_module ); /* Free what's left of the decoder */ - free( p_ac3thread->ac3_decoder->imdct ); - free( p_ac3thread->ac3_decoder ); + free( p_ac3thread->ac3_decoder->imdct_orig ); + free( p_ac3thread->ac3_decoder_orig ); } /***************************************************************************** diff --git a/plugins/ac3_adec/ac3_adec.h b/plugins/ac3_adec/ac3_adec.h index 38d331717f..91c40e6a98 100644 --- a/plugins/ac3_adec/ac3_adec.h +++ b/plugins/ac3_adec/ac3_adec.h @@ -2,7 +2,7 @@ * ac3_adec.h : ac3 decoder thread interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: ac3_adec.h,v 1.2 2002/01/22 23:14:26 massiot Exp $ + * $Id: ac3_adec.h,v 1.3 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Michel Kaempf * @@ -31,6 +31,7 @@ typedef struct ac3dec_thread_s * Decoder properties */ ac3dec_t * ac3_decoder; + void * ac3_decoder_orig; /* pointer before memalign */ /* * Thread properties diff --git a/plugins/ac3_adec/ac3_decoder.h b/plugins/ac3_adec/ac3_decoder.h index 259a5e0b42..609776dc58 100644 --- a/plugins/ac3_adec/ac3_decoder.h +++ b/plugins/ac3_adec/ac3_decoder.h @@ -2,7 +2,7 @@ * ac3_decoder.h : ac3 decoder interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: ac3_decoder.h,v 1.2 2002/02/24 20:51:09 gbazin Exp $ + * $Id: ac3_decoder.h,v 1.3 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Michel Kaempf * Renaud Dartus @@ -355,7 +355,9 @@ typedef struct mantissa_s struct ac3dec_s { float * samples; + void * samples_orig; /* pointer before memalign */ imdct_t * imdct; + void * imdct_orig; /* pointer before memalign */ /* * Input properties diff --git a/plugins/directx/vout_directx.c b/plugins/directx/vout_directx.c index a7910e4311..c7ea259630 100644 --- a/plugins/directx/vout_directx.c +++ b/plugins/directx/vout_directx.c @@ -2,7 +2,7 @@ * vout_directx.c: Windows DirectX video output display method ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vout_directx.c,v 1.29 2002/04/01 16:08:23 gbazin Exp $ + * $Id: vout_directx.c,v 1.30 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Gildas Bazin * @@ -284,7 +284,7 @@ static void vout_Destroy( vout_thread_t *p_vout ) if( p_vout->p_sys->i_event_thread_status == THREAD_READY && p_vout->p_sys->hwnd ) { - PostMessage( p_vout->p_sys->hwnd, WM_CHAR, (WPARAM)'q', 0); + PostMessage( p_vout->p_sys->hwnd, WM_CHAR, (WPARAM)'^', 0); vlc_thread_join( p_vout->p_sys->event_thread_id ); } diff --git a/plugins/dummy/vout_dummy.c b/plugins/dummy/vout_dummy.c index e624522c98..4f3cb13e7a 100644 --- a/plugins/dummy/vout_dummy.c +++ b/plugins/dummy/vout_dummy.c @@ -2,7 +2,7 @@ * vout_dummy.c: Dummy video output display method for testing purposes ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: vout_dummy.c,v 1.20 2002/03/26 23:08:40 gbazin Exp $ + * $Id: vout_dummy.c,v 1.21 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Samuel Hocevar * @@ -174,7 +174,7 @@ static void vout_End( vout_thread_t *p_vout ) for( i_index = I_OUTPUTPICTURES ; i_index ; ) { i_index--; - free( PP_OUTPUTPICTURE[ i_index ]->p_data ); + free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig ); } } @@ -234,7 +234,8 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic ) case FOURCC_YV12: /* Allocate the memory buffer */ - p_pic->p_data = memalign( 16, i_width * i_height * 3 / 2 ); + p_pic->p_data = vlc_memalign( 16, i_width * i_height * 3 / 2, + &p_pic->p_data_orig ); /* Y buffer */ p_pic->Y_PIXELS = p_pic->p_data; @@ -268,7 +269,8 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic ) case FOURCC_RV16: /* Allocate the memory buffer */ - p_pic->p_data = memalign( 16, i_width * i_height * 2 ); + p_pic->p_data = vlc_memalign( 16, i_width * i_height * 2, + &p_pic->p_data_orig ); /* Fill important structures */ p_pic->p->p_pixels = p_pic->p_data; diff --git a/plugins/mpeg_vdec/vpar_pool.c b/plugins/mpeg_vdec/vpar_pool.c index 528271c4cb..249d267f3c 100644 --- a/plugins/mpeg_vdec/vpar_pool.c +++ b/plugins/mpeg_vdec/vpar_pool.c @@ -2,7 +2,7 @@ * vpar_pool.c : management of the pool of decoder threads ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vpar_pool.c,v 1.6 2002/03/19 12:48:01 gbazin Exp $ + * $Id: vpar_pool.c,v 1.7 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Christophe Massiot * @@ -89,7 +89,8 @@ void vpar_InitPool( vpar_thread_t * p_vpar ) for( j = 0; j < 12; j++ ) { p_vpar->pool.mb.p_idcts[j].pi_block = - memalign( 16, 64 * sizeof(dctelem_t) ); + vlc_memalign( 16, 64 * sizeof(dctelem_t), + &p_vpar->pool.mb.p_idcts[j].pi_block_orig ); } } @@ -130,7 +131,7 @@ void vpar_SpawnPool( vpar_thread_t * p_vpar ) for( j = 0; j < 12; j++ ) { - free( p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block ); + free( p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block_orig ); } } @@ -167,7 +168,8 @@ void vpar_SpawnPool( vpar_thread_t * p_vpar ) for( j = 0; j < 12; j++ ) { p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block = - memalign( 16, 64 * sizeof(dctelem_t) ); + vlc_memalign( 16, 64 * sizeof(dctelem_t), + &p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block_orig ); } p_vpar->pool.pp_vdec[i] = vdec_CreateThread( &p_vpar->pool ); @@ -209,7 +211,7 @@ void vpar_EndPool( vpar_thread_t * p_vpar ) for( i = 0; i < 12; i++ ) { - free( p_vpar->pool.mb.p_idcts[i].pi_block ); + free( p_vpar->pool.mb.p_idcts[i].pi_block_orig ); } for( i = 0; i < p_vpar->pool.i_smp; i++ ) @@ -220,7 +222,7 @@ void vpar_EndPool( vpar_thread_t * p_vpar ) for( j = 0; j < 12; j++ ) { - free( p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block ); + free( p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block_orig ); } } diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index d974b3cb90..0239ec6d6b 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -5,7 +5,7 @@ * thread, and destroy a previously oppened video output thread. ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: video_output.c,v 1.170 2002/04/04 05:08:05 sam Exp $ + * $Id: video_output.c,v 1.171 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Vincent Seguin * @@ -674,7 +674,7 @@ static void EndThread( vout_thread_t *p_vout ) { if ( p_vout->p_picture[i_index].i_type == MEMORY_PICTURE ) { - free( p_vout->p_picture[i_index].p_data ); + free( p_vout->p_picture[i_index].p_data_orig ); } } diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c index d142097293..0d7ba5bb41 100644 --- a/src/video_output/vout_pictures.c +++ b/src/video_output/vout_pictures.c @@ -2,7 +2,7 @@ * vout_pictures.c : picture management functions ***************************************************************************** * Copyright (C) 2000 VideoLAN - * $Id: vout_pictures.c,v 1.19 2002/03/16 23:03:19 sam Exp $ + * $Id: vout_pictures.c,v 1.20 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -504,7 +504,7 @@ void vout_AllocatePicture( picture_t *p_pic, i_bytes += p_pic->p[ i_index ].i_lines * p_pic->p[ i_index ].i_pitch; } - p_pic->p_data = memalign( 16, i_bytes ); + p_pic->p_data = vlc_memalign( 16, i_bytes, &p_pic->p_data_orig ); if( p_pic->p_data == NULL ) { diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c index 20a2e8457d..9ab44cdefd 100644 --- a/src/video_output/vout_subpictures.c +++ b/src/video_output/vout_subpictures.c @@ -2,7 +2,7 @@ * vout_subpictures.c : subpicture management functions ***************************************************************************** * Copyright (C) 2000 VideoLAN - * $Id: vout_subpictures.c,v 1.11 2002/03/15 04:41:54 sam Exp $ + * $Id: vout_subpictures.c,v 1.12 2002/04/05 01:05:22 gbazin Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -125,8 +125,8 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type, if( (p_free_subpic == NULL) && (p_destroyed_subpic != NULL ) ) { /* No free subpicture or matching destroyed subpictures have been - * found, but a destroyed subpicture is still avalaible */ - free( p_destroyed_subpic->p_sys ); + * found, but a destroyed subpicture is still available */ + free( p_destroyed_subpic->p_sys_orig ); p_free_subpic = p_destroyed_subpic; } @@ -138,7 +138,8 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type, return( NULL ); } - p_free_subpic->p_sys = memalign( 16, i_size ); + p_free_subpic->p_sys = + vlc_memalign( 16, i_size, &p_free_subpic->p_sys_orig ); if( p_free_subpic->p_sys != NULL ) {