pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/ffmpeg Provide code pathes using posix_mema...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/523c3b3ad3c5
branches:  trunk
changeset: 547041:523c3b3ad3c5
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Sep 11 12:08:41 2008 +0000

description:
Provide code pathes using posix_memalign, applies  at leas to NetBSD
current.

diffstat:

 multimedia/ffmpeg/Makefile                |   4 +-
 multimedia/ffmpeg/distinfo                |   5 ++-
 multimedia/ffmpeg/patches/patch-configure |  33 +++++++++++++++++++++--
 multimedia/ffmpeg/patches/patch-mem.c     |  42 +++++++++++++++++++++++++++++++
 4 files changed, 76 insertions(+), 8 deletions(-)

diffs (133 lines):

diff -r 5923acf762fc -r 523c3b3ad3c5 multimedia/ffmpeg/Makefile
--- a/multimedia/ffmpeg/Makefile        Thu Sep 11 12:04:52 2008 +0000
+++ b/multimedia/ffmpeg/Makefile        Thu Sep 11 12:08:41 2008 +0000
@@ -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 -r 5923acf762fc -r 523c3b3ad3c5 multimedia/ffmpeg/distinfo
--- a/multimedia/ffmpeg/distinfo        Thu Sep 11 12:04:52 2008 +0000
+++ b/multimedia/ffmpeg/distinfo        Thu Sep 11 12:08:41 2008 +0000
@@ -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 -r 5923acf762fc -r 523c3b3ad3c5 multimedia/ffmpeg/patches/patch-configure
--- a/multimedia/ffmpeg/patches/patch-configure Thu Sep 11 12:04:52 2008 +0000
+++ b/multimedia/ffmpeg/patches/patch-configure Thu Sep 11 12:08:41 2008 +0000
@@ -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 @@
  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 @@
  
  # ---
  # 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 -r 5923acf762fc -r 523c3b3ad3c5 multimedia/ffmpeg/patches/patch-mem.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg/patches/patch-mem.c     Thu Sep 11 12:08:41 2008 +0000
@@ -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



Home | Main Index | Thread Index | Old Index