diff options
| author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2010-04-14 16:22:21 +0000 |
|---|---|---|
| committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2010-04-14 16:22:21 +0000 |
| commit | 2f17f561b50fe9bcd0fa4a3999b96affb272a1c6 (patch) | |
| tree | 51579baaa23c1a2a90c80b942721ed21f190d2df /multimedia/vlc/files/extra-patch-modules_access_v4l2.c | |
| parent | Wii remote is an innovative hci developed by Nintendo. (diff) | |
- Fix build on 6.x
PR: 144086
Submitted by: Mark Andrews <marka@isc.org>
Approved by: maintainer timeout
Diffstat (limited to '')
| -rw-r--r-- | multimedia/vlc/files/extra-patch-modules_access_v4l2.c | 71 |
1 files changed, 71 insertions, 0 deletions
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; |
