summaryrefslogtreecommitdiff
path: root/v4l2-apps/libv4l
diff options
context:
space:
mode:
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-03-11 13:08:13 +0100
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-03-11 13:08:13 +0100
commitddf0a05516ddaefd3c473a3cc2bf5d6e170e5698 (patch)
treeda1af8939b06a7d73b69223e9170ea6a603ba82f /v4l2-apps/libv4l
parenta5d0ef3556720bdb676c2c752b27e02be2d7e869 (diff)
downloadmediapointer-dvb-s2-ddf0a05516ddaefd3c473a3cc2bf5d6e170e5698.tar.gz
mediapointer-dvb-s2-ddf0a05516ddaefd3c473a3cc2bf5d6e170e5698.tar.bz2
libv4l: don't use memcmp to compare pix_formats
From: Hans de Goede <hdegoede@redhat.com> Only check width, height and pixelformat when checking if we are doing conversion, instead of doing a memcmp, as that are the only things which the convert code checks Priority: normal Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l')
-rw-r--r--v4l2-apps/libv4l/ChangeLog3
-rw-r--r--v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/v4l2-apps/libv4l/ChangeLog b/v4l2-apps/libv4l/ChangeLog
index 04d9931b5..c68c05445 100644
--- a/v4l2-apps/libv4l/ChangeLog
+++ b/v4l2-apps/libv4l/ChangeLog
@@ -6,6 +6,9 @@ libv4l-0.5.2
s_fmt in their try_fmt answer
* Check that s_fmt atleast gives us the width, height and pixelformat try_fmt
promised us, and if not disable conversion
+* Only check width, height and pixelformat when checking if we are doing
+ conversion, instead of doing a memcmp, as that are the only things which
+ the convert code checks
libv4l-0.5.1
------------
diff --git a/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c b/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c
index 3e93d98cc..daced73dd 100644
--- a/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c
+++ b/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c
@@ -301,7 +301,9 @@ int v4lconvert_try_format(struct v4lconvert_data *data,
}
/* Are we converting? */
- if(memcmp(&try_src, &try_dest, sizeof(try_src)))
+ if(try_src.fmt.pix.width != try_dest.fmt.pix.width ||
+ try_src.fmt.pix.height != try_dest.fmt.pix.height ||
+ try_src.fmt.pix.pixelformat != try_dest.fmt.pix.pixelformat)
v4lconvert_fixup_fmt(&try_dest);
*dest_fmt = try_dest;
@@ -316,7 +318,9 @@ int v4lconvert_needs_conversion(struct v4lconvert_data *data,
const struct v4l2_format *src_fmt, /* in */
const struct v4l2_format *dest_fmt) /* in */
{
- if(memcmp(src_fmt, dest_fmt, sizeof(*src_fmt)))
+ if(src_fmt->fmt.pix.width != dest_fmt->fmt.pix.width ||
+ src_fmt->fmt.pix.height != dest_fmt->fmt.pix.height ||
+ src_fmt->fmt.pix.pixelformat != dest_fmt->fmt.pix.pixelformat)
return 1; /* Formats differ */
if (!(data->flags & (V4LCONVERT_ROTATE_90|V4LCONVERT_ROTATE_180)))