summaryrefslogtreecommitdiff
path: root/multimedia
diff options
context:
space:
mode:
authorjoerg <joerg>2008-09-11 12:08:41 +0000
committerjoerg <joerg>2008-09-11 12:08:41 +0000
commit867f13c40b562750a39303a500edcddec9799301 (patch)
treeccb0419c2e4914a06c28c006f5dd33eb9e236d23 /multimedia
parent976818876a293f7224d694b50de510bc21ef7f54 (diff)
downloadpkgsrc-867f13c40b562750a39303a500edcddec9799301.tar.gz
Provide code pathes using posix_memalign, applies at leas to NetBSD
current.
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/ffmpeg/Makefile4
-rw-r--r--multimedia/ffmpeg/distinfo5
-rw-r--r--multimedia/ffmpeg/patches/patch-configure33
-rw-r--r--multimedia/ffmpeg/patches/patch-mem.c42
4 files changed, 76 insertions, 8 deletions
diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile
index d6701c1477e..1e60d56ece0 100644
--- a/multimedia/ffmpeg/Makefile
+++ b/multimedia/ffmpeg/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.39 2008/09/08 17:57:02 ahoka Exp $
+# $NetBSD: Makefile,v 1.40 2008/09/11 12:08:41 joerg Exp $
DISTNAME= ffmpeg-${DISTVERSION}
PKGNAME= ffmpeg-${DISTVERSION:S/-//g}
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_FREEBSD}
EXTRACT_SUFX= .tar.bz2
diff --git a/multimedia/ffmpeg/distinfo b/multimedia/ffmpeg/distinfo
index 13a23923ccc..ad28bae176c 100644
--- a/multimedia/ffmpeg/distinfo
+++ b/multimedia/ffmpeg/distinfo
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.17 2008/09/08 00:16:35 ahoka Exp $
+$NetBSD: distinfo,v 1.18 2008/09/11 12:08:41 joerg Exp $
SHA1 (ffmpeg-2008-07-27.tar.bz2) = 103acde7a0f02aa1c32d5dab5bf187c94441c479
RMD160 (ffmpeg-2008-07-27.tar.bz2) = e69128fc034a3f8b0fd561f1e6ecc04dd118a977
Size (ffmpeg-2008-07-27.tar.bz2) = 2581976 bytes
SHA1 (patch-bktr) = dddf7149810d227f531e5a198445fc0d1893bece
-SHA1 (patch-configure) = 61d547264afd2ae99fc4837fce1bd830db36ab26
+SHA1 (patch-configure) = 747593b082f428ac1f79c6d9cad8773326351a83
+SHA1 (patch-mem.c) = b31dd3c0a53da58be34e5f6c0cbf36454649a85f
SHA1 (patch-r14477) = fb68f691fe68b6dc4ddd31c4c366d0dae11ab999
SHA1 (patch-v4l2) = ed35dbd2d08337239f051c74c414e01609fb6ef6
diff --git a/multimedia/ffmpeg/patches/patch-configure b/multimedia/ffmpeg/patches/patch-configure
index 37448b0e63f..f02506753cf 100644
--- a/multimedia/ffmpeg/patches/patch-configure
+++ b/multimedia/ffmpeg/patches/patch-configure
@@ -1,8 +1,16 @@
-$NetBSD: patch-configure,v 1.2 2008/09/08 00:16:35 ahoka Exp $
+$NetBSD: patch-configure,v 1.3 2008/09/11 12:08:41 joerg Exp $
--- configure.orig 2008-07-24 12:53:32.000000000 +0200
+++ configure
-@@ -891,7 +891,7 @@ rtp_muxer_deps="network rtp_protocol"
+@@ -763,6 +763,7 @@ HAVE_LIST="
+ memalign
+ mkstemp
+ pld
++ posix_memalign
+ ppc64
+ round
+ roundf
+@@ -891,7 +892,7 @@ rtp_muxer_deps="network rtp_protocol"
rtsp_demuxer_deps="sdp_demuxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
v4l_demuxer_deps="linux_videodev_h"
@@ -11,7 +19,7 @@ $NetBSD: patch-configure,v 1.2 2008/09/08 00:16:35 ahoka Exp $
vfwcap_demuxer_deps="capCreateCaptureWindow"
vfwcap_demuxer_extralibs="-lvfw32"
x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
-@@ -1586,10 +1586,14 @@ enabled vis && add_cflags "-mcpu=ultrasp
+@@ -1586,10 +1587,14 @@ enabled vis && add_cflags "-mcpu=ultrasp
# ---
# big/little-endian test
@@ -29,7 +37,24 @@ $NetBSD: patch-configure,v 1.2 2008/09/08 00:16:35 ahoka Exp $
# ---
# check availability of some header files
-@@ -1789,6 +1793,7 @@ EOF
+@@ -1605,6 +1610,7 @@ check_func gethrtime
+ check_func getrusage
+ check_func inet_aton $network_extralibs
+ check_func memalign
++check_func posix_memalign
+ check_func mkstemp
+ check_func2 windows.h GetProcessTimes
+
+@@ -1616,7 +1622,7 @@ check_header sys/mman.h
+ check_header sys/resource.h
+ check_header termios.h
+
+-if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
++if ! enabled_any memalign memalign_hack posix_memalign && enabled need_memalign ; then
+ die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
+ fi
+
+@@ -1789,6 +1795,7 @@ EOF
check_header linux/videodev.h
check_header linux/videodev2.h
diff --git a/multimedia/ffmpeg/patches/patch-mem.c b/multimedia/ffmpeg/patches/patch-mem.c
new file mode 100644
index 00000000000..22453a655c5
--- /dev/null
+++ b/multimedia/ffmpeg/patches/patch-mem.c
@@ -0,0 +1,42 @@
+$NetBSD: patch-mem.c,v 1.1 2008/09/11 12:08:41 joerg Exp $
+
+--- libavutil/mem.c.orig 2008-05-23 14:37:52.000000000 +0200
++++ libavutil/mem.c
+@@ -85,6 +85,9 @@ void *av_malloc(unsigned int size)
+
+ btw, malloc seems to do 8 byte alignment by default here
+ */
++#elif defined (HAVE_MEMALIGN)
++ if (posix_memalign(&ptr, 16, size))
++ return NULL;
+ #else
+ ptr = malloc(size);
+ #endif
+@@ -95,6 +98,8 @@ void *av_realloc(void *ptr, unsigned int
+ {
+ #ifdef CONFIG_MEMALIGN_HACK
+ int diff;
++#elif defined (HAVE_MEMALIGN)
++ void *new_ptr;
+ #endif
+
+ /* let's disallow possible ambiguous cases */
+@@ -106,6 +111,18 @@ void *av_realloc(void *ptr, unsigned int
+ if(!ptr) return av_malloc(size);
+ diff= ((char*)ptr)[-1];
+ return (char*)realloc((char*)ptr - diff, size + diff) + diff;
++#elif defined (HAVE_MEMALIGN)
++ new_ptr = realloc(ptr, size);
++ if (((size_t)new_ptr & 15) == 0)
++ return new_ptr;
++
++ if (posix_memalign(&ptr, 16, size)) {
++ free(new_ptr);
++ return NULL;
++ }
++ memcpy(ptr, new_ptr, size);
++ free(new_ptr);
++ return ptr;
+ #else
+ return realloc(ptr, size);
+ #endif