diff options
author | Thierry MERLE <thierry.merle@free.fr> | 2008-07-08 20:48:40 +0200 |
---|---|---|
committer | Thierry MERLE <thierry.merle@free.fr> | 2008-07-08 20:48:40 +0200 |
commit | f891b6be28d6ffd359659d88bc2feb6133a2a38c (patch) | |
tree | b3284392e47f3e92b4acedc42bc04d9a74d6ec28 | |
parent | d784aba6717da44bfef18007146f6d00280e39fe (diff) | |
download | mediapointer-dvb-s2-f891b6be28d6ffd359659d88bc2feb6133a2a38c.tar.gz mediapointer-dvb-s2-f891b6be28d6ffd359659d88bc2feb6133a2a38c.tar.bz2 |
v4l2-library: libv4l-0.3.4 (the brownpaperbag release) - final patch
From: Hans de Goede <j.w.r.degoede@hhs.nl>
* The mmap64 support in 0.3.3, has caused a bug in libv4l1 when running on
32 bit systems (who uses those now a days?), this bug caused v4l1
compatibility to not work at all, this release fixes this
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
-rw-r--r-- | v4l2-apps/lib/libv4l/ChangeLog | 4 | ||||
-rw-r--r-- | v4l2-apps/lib/libv4l/libv4l1/libv4l1-priv.h | 9 | ||||
-rw-r--r-- | v4l2-apps/lib/libv4l/libv4l1/libv4l1.c | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/v4l2-apps/lib/libv4l/ChangeLog b/v4l2-apps/lib/libv4l/ChangeLog index 14c5625a1..def38e046 100644 --- a/v4l2-apps/lib/libv4l/ChangeLog +++ b/v4l2-apps/lib/libv4l/ChangeLog @@ -1,5 +1,5 @@ -libv4l-0.3.4 ------------- +libv4l-0.3.4 (the brownpaperbag release) +---------------------------------------- * The mmap64 support in 0.3.3, has caused a bug in libv4l1 when running on 32 bit systems (who uses those now a days?), this bug caused v4l1 compatibility to not work at all, this release fixes this diff --git a/v4l2-apps/lib/libv4l/libv4l1/libv4l1-priv.h b/v4l2-apps/lib/libv4l/libv4l1/libv4l1-priv.h index e107581d1..e09041256 100644 --- a/v4l2-apps/lib/libv4l/libv4l1/libv4l1-priv.h +++ b/v4l2-apps/lib/libv4l/libv4l1/libv4l1-priv.h @@ -22,6 +22,15 @@ #include <stdio.h> #include <pthread.h> +/* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */ +#ifdef __NR_mmap2 +#define SYS_mmap2 __NR_mmap2 +#define MMAP2_PAGE_SHIFT 12 +#else +#define SYS_mmap2 SYS_mmap +#define MMAP2_PAGE_SHIFT 0 +#endif + #define V4L1_MAX_DEVICES 16 #define V4L1_NO_FRAMES 4 #define V4L1_FRAME_BUF_SIZE (4096 * 4096) diff --git a/v4l2-apps/lib/libv4l/libv4l1/libv4l1.c b/v4l2-apps/lib/libv4l/libv4l1/libv4l1.c index 40e4b2aa1..b80fcb56d 100644 --- a/v4l2-apps/lib/libv4l/libv4l1/libv4l1.c +++ b/v4l2-apps/lib/libv4l/libv4l1/libv4l1.c @@ -644,7 +644,7 @@ int v4l1_ioctl (int fd, unsigned long int request, ...) } if (devices[index].v4l1_frame_pointer == MAP_FAILED) { - devices[index].v4l1_frame_pointer = (void *)syscall(SYS_mmap, NULL, + devices[index].v4l1_frame_pointer = (void *)syscall(SYS_mmap2, NULL, (size_t)mbuf->size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); |