summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-video.c
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
commit6ebc4db113b06e0a7390faa61f891ef23d3a483a (patch)
tree9effa991b425021b86289ec95df4985314918f93 /linux/drivers/media/video/saa7134/saa7134-video.c
parent1892adfab10cb9deee0fef6c601bf0ed01daa384 (diff)
downloadmediapointer-dvb-s2-6ebc4db113b06e0a7390faa61f891ef23d3a483a.tar.gz
mediapointer-dvb-s2-6ebc4db113b06e0a7390faa61f891ef23d3a483a.tar.bz2
saa7134: 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>
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c
index 26f1727e6..ddf842a0d 100644
--- a/linux/drivers/media/video/saa7134/saa7134-video.c
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c
@@ -1646,15 +1646,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 =