diff options
author | Trent Piepho | 2009-05-31 02:45:46 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2009-06-23 08:21:18 +0200 |
commit | 3adbbb8e2a87d58401466c825e9ff191e3b5a7b6 (patch) | |
tree | 1039ab75a8f84b50e6ffd92a9bfc6b1cd7c7402d /drivers/media/video/vivi.c | |
parent | V4L/DVB (11904): zoran: Use v4l bounding/alignment functiob (diff) | |
download | kernel-qcow2-linux-3adbbb8e2a87d58401466c825e9ff191e3b5a7b6.tar.gz kernel-qcow2-linux-3adbbb8e2a87d58401466c825e9ff191e3b5a7b6.tar.xz kernel-qcow2-linux-3adbbb8e2a87d58401466c825e9ff191e3b5a7b6.zip |
V4L/DVB (11905): vivi: Use v4l bounding/alignment function
The v4l function has a better algorithm for aligning image size.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/vivi.c')
-rw-r--r-- | drivers/media/video/vivi.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index fbfefae7886f..cd7266858462 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c @@ -883,15 +883,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 = |