[vlc-commits] vout_subpicture: fix cropping
Francois Cartegnie
git at videolan.org
Wed Jan 3 19:50:55 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 2 21:41:37 2018 +0100| [f03f900c1d5955f2d75dc6113c470e3fc5127c61] | committer: Francois Cartegnie
vout_subpicture: fix cropping
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f03f900c1d5955f2d75dc6113c470e3fc5127c61
---
src/video_output/vout_subpictures.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 50c358be04..5524347887 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -905,10 +905,10 @@ static void SpuRenderRegion(spu_t *spu,
if (crop_requested) {
int crop_x, crop_y, crop_width, crop_height;
if(sys->force_crop){
- crop_x = sys->crop.x;
- crop_y = sys->crop.y;
- crop_width = sys->crop.width;
- crop_height= sys->crop.height;
+ crop_x = spu_scale_w(sys->crop.x, scale_size);
+ crop_y = spu_scale_h(sys->crop.y, scale_size);
+ crop_width = spu_scale_w(sys->crop.width, scale_size);
+ crop_height= spu_scale_h(sys->crop.height, scale_size);
}
else
{
@@ -918,16 +918,11 @@ static void SpuRenderRegion(spu_t *spu,
crop_height = region_fmt.i_visible_height;
}
- if(region->i_max_width && region->i_max_width < crop_width)
- crop_width = region->i_max_width;
+ if(region->i_max_width && spu_scale_w(region->i_max_width, scale_size) < crop_width)
+ crop_width = spu_scale_w(region->i_max_width, scale_size);
- if(region->i_max_height && region->i_max_height < crop_height)
- crop_height = region->i_max_height;
-
- crop_x = spu_scale_w(crop_x, scale_size);
- crop_y = spu_scale_h(crop_y, scale_size);
- crop_width = spu_scale_w(crop_width, scale_size);
- crop_height= spu_scale_h(crop_height,scale_size);
+ if(region->i_max_height && spu_scale_h(region->i_max_height, scale_size) < crop_height)
+ crop_height = spu_scale_h(region->i_max_height, scale_size);
/* Find the intersection */
if (crop_x + crop_width <= x_offset ||
More information about the vlc-commits
mailing list