diff options
author | Andy Walls <awalls@radix.net> | 2009-02-28 12:51:47 -0500 |
---|---|---|
committer | Andy Walls <awalls@radix.net> | 2009-02-28 12:51:47 -0500 |
commit | dab02fd6f0416a4ac1e76213a63b9900ee7b5133 (patch) | |
tree | ca76ef5d0353e451afd12691fa07c8ca9af93897 /linux/drivers/media/video/cx18 | |
parent | d0d7f86bddbb6e03debcd8c07cce1d710fd8a870 (diff) | |
download | mediapointer-dvb-s2-dab02fd6f0416a4ac1e76213a63b9900ee7b5133.tar.gz mediapointer-dvb-s2-dab02fd6f0416a4ac1e76213a63b9900ee7b5133.tar.bz2 |
cx18: Fix a video scaling check problem introduced by sliced VBI changes
From: Andy Walls <awalls@radix.net>
Fix a scaling check that was failing, due to a magic number I missed fixing
during previous slice VBI changes. Now
$ v4l2-ctl -v width=480,height=480,pixelformat=MPEG
yields proper visual results again.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/cx18')
-rw-r--r-- | linux/drivers/media/video/cx18/cx18-av-core.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-av-core.c b/linux/drivers/media/video/cx18/cx18-av-core.c index cf256a999..aeeb3cfa3 100644 --- a/linux/drivers/media/video/cx18/cx18-av-core.c +++ b/linux/drivers/media/video/cx18/cx18-av-core.c @@ -867,8 +867,22 @@ static int cx18_av_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) Hsrc = (cx18_av_read(cx, 0x472) & 0x3f) << 4; Hsrc |= (cx18_av_read(cx, 0x471) & 0xf0) >> 4; - Vlines = pix->height + (is_50Hz ? 4 : 7); + /* + * This adjustment reflects the excess of vactive, set in + * cx18_av_std_setup(), above standard values: + * + * 480 + 1 for 60 Hz systems + * 576 + 4 for 50 Hz systems + */ + Vlines = pix->height + (is_50Hz ? 4 : 1); + /* + * Invalid height and width scaling requests are: + * 1. width less than 1/16 of the source width + * 2. width greater than the source width + * 3. height less than 1/8 of the source height + * 4. height greater than the source height + */ if ((pix->width * 16 < Hsrc) || (Hsrc < pix->width) || (Vlines * 8 < Vsrc) || (Vsrc < Vlines)) { CX18_ERR_DEV(sd, "%dx%d is not a valid size!\n", |