diff options
Diffstat (limited to 'v4l2-apps/libv4l')
-rw-r--r-- | v4l2-apps/libv4l/ChangeLog | 3 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c | 8 |
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))) |