summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-05-30 17:45:46 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2009-05-30 17:45:46 -0700
commit1892adfab10cb9deee0fef6c601bf0ed01daa384 (patch)
tree79d0456de6b6e78dc7aefe791301b51c58821576
parent8c986b899b3f035b94b4ee568ce00a8a48c12f45 (diff)
downloadmediapointer-dvb-s2-1892adfab10cb9deee0fef6c601bf0ed01daa384.tar.gz
mediapointer-dvb-s2-1892adfab10cb9deee0fef6c601bf0ed01daa384.tar.bz2
vivi: Use v4l bounding/alignment function
From: Trent Piepho <xyzzy@speakeasy.org> The v4l function has a better algorithm for aligning image size. Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-rw-r--r--linux/drivers/media/video/vivi.c11
1 files changed, 2 insertions, 9 deletions
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 =