mirror of
https://github.com/torvalds/linux.git
synced 2024-12-05 10:32:35 +00:00
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>
This commit is contained in:
parent
728f5b93f4
commit
3adbbb8e2a
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user