diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-05-30 20:45:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-23 02:21:19 -0400 |
commit | 9bd0e8d7d1bf0dc586bad905c7878b611da3acdc (patch) | |
tree | a6a791c8b653d8296d6f0d5f9513fdf722ee33fe /drivers/media | |
parent | 653dc59b6468c2ba51f3b4aee609daa8f67d3e3a (diff) |
V4L/DVB (11911): cx231xx: Use v4l bounding/alignment function
The v4l function has a better algorithm for aligning image size.
Cc: Srinivasa Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-video.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c index a23ae73fe634..6a524d847110 100644 --- a/drivers/media/video/cx231xx/cx231xx-video.c +++ b/drivers/media/video/cx231xx/cx231xx-video.c | |||
@@ -955,8 +955,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
955 | { | 955 | { |
956 | struct cx231xx_fh *fh = priv; | 956 | struct cx231xx_fh *fh = priv; |
957 | struct cx231xx *dev = fh->dev; | 957 | struct cx231xx *dev = fh->dev; |
958 | int width = f->fmt.pix.width; | 958 | unsigned int width = f->fmt.pix.width; |
959 | int height = f->fmt.pix.height; | 959 | unsigned int height = f->fmt.pix.height; |
960 | unsigned int maxw = norm_maxw(dev); | 960 | unsigned int maxw = norm_maxw(dev); |
961 | unsigned int maxh = norm_maxh(dev); | 961 | unsigned int maxh = norm_maxh(dev); |
962 | unsigned int hscale, vscale; | 962 | unsigned int hscale, vscale; |
@@ -971,17 +971,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
971 | 971 | ||
972 | /* width must even because of the YUYV format | 972 | /* width must even because of the YUYV format |
973 | height must be even because of interlacing */ | 973 | height must be even because of interlacing */ |
974 | height &= 0xfffe; | 974 | v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0); |
975 | width &= 0xfffe; | ||
976 | |||
977 | if (unlikely(height < 32)) | ||
978 | height = 32; | ||
979 | if (unlikely(height > maxh)) | ||
980 | height = maxh; | ||
981 | if (unlikely(width < 48)) | ||
982 | width = 48; | ||
983 | if (unlikely(width > maxw)) | ||
984 | width = maxw; | ||
985 | 975 | ||
986 | get_scale(dev, width, height, &hscale, &vscale); | 976 | get_scale(dev, width, height, &hscale, &vscale); |
987 | 977 | ||