]> Pileus Git - ~andy/linux/blobdiff - drivers/media/video/saa7134/saa7134-video.c
V4L/DVB (11906): saa7134: Use v4l bounding/alignment function
[~andy/linux] / drivers / media / video / saa7134 / saa7134-video.c
index e305c1674cee2415432519b2b6caf28062411cd0..ba87128542e03254aa27e5ab3f55dbcca869cffa 100644 (file)
@@ -1640,15 +1640,8 @@ static int saa7134_try_fmt_vid_cap(struct file *file, void *priv,
        }
 
        f->fmt.pix.field = field;
-       if (f->fmt.pix.width  < 48)
-               f->fmt.pix.width  = 48;
-       if (f->fmt.pix.height < 32)
-               f->fmt.pix.height = 32;
-       if (f->fmt.pix.width > maxw)
-               f->fmt.pix.width = maxw;
-       if (f->fmt.pix.height > maxh)
-               f->fmt.pix.height = maxh;
-       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 =