V4L/DVB (13129): sh_mobile_ceu_camera: fix cropping for scaling clients
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Mon, 5 Oct 2009 15:51:47 +0000 (12:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 7 Nov 2009 14:55:06 +0000 (12:55 -0200)
Fix a bug in cropping calculation, when the client is also scaling the image.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/sh_mobile_ceu_camera.c

index 65ac474c517acf9a3df55f4b4f20be35ca91dd4b..2f78b4f263f5861008bedb906809155b95ef3c46 100644 (file)
@@ -1173,8 +1173,8 @@ static int get_scales(struct soc_camera_device *icd,
        width_in = scale_up(cam->ceu_rect.width, *scale_h);
        height_in = scale_up(cam->ceu_rect.height, *scale_v);
 
-       *scale_h = calc_generic_scale(cam->ceu_rect.width, icd->user_width);
-       *scale_v = calc_generic_scale(cam->ceu_rect.height, icd->user_height);
+       *scale_h = calc_generic_scale(width_in, icd->user_width);
+       *scale_v = calc_generic_scale(height_in, icd->user_height);
 
        return 0;
 }