[vlc-commits] vout: don't clobber crop borders when updating

Rémi Denis-Courmont git at videolan.org
Mon Feb 8 15:15:05 UTC 2021


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb  6 17:59:10 2021 +0200| [0697ef19db666888c304a87893d47d4ffef60467] | committer: Rémi Denis-Courmont

vout: don't clobber crop borders when updating

The vout_UpdateSourceCrop() function uses the crop borders as both
inputs and outputs. There does not seem to be any good reason to
overwrite the values though.

Within vout_UpdateSourceCrop(), the value should actually not change
(much like the aspect ratio numerator and denominator in the previous
patchset), except for rounding errors and out-of-bound results.

The values are used in only one other function, vout_SetDisplayCrop().
There, old and new values are compared to avoid needlessly resetting
the display. Those comparisons actually work correctly only if the
values are *not* modified by vout_UpdateSourceCrop().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0697ef19db666888c304a87893d47d4ffef60467
---

 src/video_output/display.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 06fb16ffc1..6d91d57849 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -495,15 +495,7 @@ static int vout_UpdateSourceCrop(vout_display_t *vd)
     video_format_Print(VLC_OBJECT(vd), "SOURCE ", &fmt);
     video_format_Print(VLC_OBJECT(vd), "CROPPED ", &osys->source);
 
-    int ret = vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_CROP);
-    osys->crop.left   = left - osys->source.i_x_offset;
-    osys->crop.top    = top  - osys->source.i_y_offset;
-    /* FIXME for right/bottom we should keep the 'type' border vs window */
-    osys->crop.right  = right -
-                        (osys->source.i_x_offset + osys->source.i_visible_width);
-    osys->crop.bottom = bottom -
-                        (osys->source.i_y_offset + osys->source.i_visible_height);
-    return ret;
+    return vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_CROP);
 }
 
 static int vout_SetSourceAspect(vout_display_t *vd,



More information about the vlc-commits mailing list