From 1892adfab10cb9deee0fef6c601bf0ed01daa384 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Sat, 30 May 2009 17:45:46 -0700 Subject: vivi: Use v4l bounding/alignment function From: Trent Piepho The v4l function has a better algorithm for aligning image size. Priority: normal Signed-off-by: Trent Piepho --- linux/drivers/media/video/vivi.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'linux/drivers/media/video') diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index e3bc2b0a3..fe39b7326 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -886,15 +886,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, maxh = norm_maxh(); f->fmt.pix.field = field; - if (f->fmt.pix.height < 32) - f->fmt.pix.height = 32; - if (f->fmt.pix.height > maxh) - f->fmt.pix.height = maxh; - if (f->fmt.pix.width < 48) - f->fmt.pix.width = 48; - if (f->fmt.pix.width > maxw) - f->fmt.pix.width = maxw; - f->fmt.pix.width &= ~0x03; + v4l_bound_align_image(&f->fmt.pix.width, 48, maxw, 2, + &f->fmt.pix.height, 32, maxh, 0, 0); f->fmt.pix.bytesperline = (f->fmt.pix.width * fmt->depth) >> 3; f->fmt.pix.sizeimage = -- cgit v1.2.3