aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/vlc
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2010-04-15 00:22:21 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2010-04-15 00:22:21 +0800
commit85909742ac99ace3691697f02fe0a92b806bd09d (patch)
tree66707bae06538ff350cd2ad16ed738c5df7dea8f /multimedia/vlc
parentaf4d7013cb1950137291f3763805235b16ea57c4 (diff)
downloadfreebsd-ports-gnome-85909742ac99ace3691697f02fe0a92b806bd09d.tar.gz
freebsd-ports-gnome-85909742ac99ace3691697f02fe0a92b806bd09d.tar.zst
freebsd-ports-gnome-85909742ac99ace3691697f02fe0a92b806bd09d.zip
- Fix build on 6.x
PR: 144086 Submitted by: Mark Andrews <marka@isc.org> Approved by: maintainer timeout
Diffstat (limited to 'multimedia/vlc')
-rw-r--r--multimedia/vlc/Makefile4
-rw-r--r--multimedia/vlc/files/extra-patch-modules_access_v4l2.c71
2 files changed, 75 insertions, 0 deletions
diff --git a/multimedia/vlc/Makefile b/multimedia/vlc/Makefile
index 2441e3b28d69..8c3a588dca20 100644
--- a/multimedia/vlc/Makefile
+++ b/multimedia/vlc/Makefile
@@ -113,6 +113,10 @@ IGNORE= does not build on FreeBSD 6.x with Qt4.x, set this OPTION to off or defi
CFLAGS+= -DHAVE_SYS_MOUNT_H
.endif
+.if (${OSVERSION} < 700000)
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-modules_access_v4l2.c
+.endif
+
WITH_VLC_DEFAULT_FONT?= ${LOCALBASE}/lib/X11/fonts/bitstream-vera/Vera.ttf
.if ${PERL_LEVEL} < 500800
diff --git a/multimedia/vlc/files/extra-patch-modules_access_v4l2.c b/multimedia/vlc/files/extra-patch-modules_access_v4l2.c
new file mode 100644
index 000000000000..02ac708d65d2
--- /dev/null
+++ b/multimedia/vlc/files/extra-patch-modules_access_v4l2.c
@@ -0,0 +1,71 @@
+--- modules/access/v4l2.c.orig 2009-12-21 04:43:39.000000000 +1100
++++ modules/access/v4l2.c 2010-02-19 13:29:51.000000000 +1100
+@@ -492,6 +492,9 @@
+ {
+ void * start;
+ size_t length;
++#if !defined (HAVE_POSIX_MEMALIGN) && !defined (HAVE_MEMALIGN)
++ void * free;
++#endif
+ };
+
+ struct demux_sys_t
+@@ -1038,7 +1041,12 @@
+ switch( p_sys->io )
+ {
+ case IO_METHOD_READ:
+- free( p_sys->p_buffers[0].start );
++#if !defined (HAVE_POSIX_MEMALIGN) && !defined (HAVE_MEMALIGN)
++ if (p_sys->p_buffers[0].free)
++ free( p_sys->p_buffers[0].free );
++ else
++#endif
++ free( p_sys->p_buffers[0].start );
+ break;
+
+ case IO_METHOD_MMAP:
+@@ -1054,7 +1062,12 @@
+ case IO_METHOD_USERPTR:
+ for( i = 0; i < p_sys->i_nbuffers; ++i )
+ {
+- free( p_sys->p_buffers[i].start );
++#if !defined (HAVE_POSIX_MEMALIGN) && !defined (HAVE_MEMALIGN)
++ if (p_sys->p_buffers[0].free)
++ free( p_sys->p_buffers[i].free );
++ else
++#endif
++ free( p_sys->p_buffers[i].start );
+ }
+ break;
+
+@@ -1600,10 +1613,31 @@
+
+ for( p_sys->i_nbuffers = 0; p_sys->i_nbuffers < 4; ++p_sys->i_nbuffers )
+ {
++#if defined (HAVE_POSIX_MEMALIGN)
+ p_sys->p_buffers[p_sys->i_nbuffers].length = i_buffer_size;
+ if( posix_memalign( &p_sys->p_buffers[p_sys->i_nbuffers].start,
+ /* boundary */ i_page_size, i_buffer_size ) )
+ goto open_failed;
++#elif defined (HAVE_MEMALIGN)
++ p_sys->p_buffers[p_sys->i_nbuffers].length = i_buffer_size;
++ p_sys->p_buffers[p_sys->i_nbuffers].start =
++ memalign ( /* boundary */ i_page_size, i_buffer_size );
++ if (p_sys->p_buffers[p_sys->i_nbuffers].start == NULL)
++ goto open_failed;
++#else
++ unsigned char *ptr;
++ size_t align = i_page_size - 1;
++
++ p_sys->p_buffers[p_sys->i_nbuffers].length = i_buffer_size;
++ ptr = malloc (i_buffer_size + align);
++ if ( ptr == NULL )
++ goto open_failed;
++
++ p_sys->p_buffers[p_sys->i_nbuffers].free = ptr;
++ ptr += align;
++ p_sys->p_buffers[p_sys->i_nbuffers].start =
++ (void *)(((uintptr_t)ptr) & ~align);
++#endif
+ }
+ return VLC_SUCCESS;