[vlc-commits] vout: update "crop" when "crop-{top, bottom, left, right}" is used

Rémi Denis-Courmont git at videolan.org
Thu Oct 23 20:19:38 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct 22 19:27:58 2014 +0300| [6c490e5f693809e50e7dc2ffb11ca86e43b118d3] | committer: Rémi Denis-Courmont

vout: update "crop" when "crop-{top,bottom,left,right}" is used

This makes sure that the "crop" variable always represents the current
crop settings.

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

 src/video_output/vout_intf.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index f7b0bb7..f51550b 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -561,14 +561,16 @@ static int CropCallback( vlc_object_t *object, char const *cmd,
 static int CropBorderCallback(vlc_object_t *object, char const *cmd,
                               vlc_value_t oldval, vlc_value_t newval, void *data)
 {
-    vout_thread_t *vout = (vout_thread_t *)object;
-    VLC_UNUSED(cmd); VLC_UNUSED(oldval); VLC_UNUSED(data); VLC_UNUSED(newval);
+    char buf[4 * 21];
 
-    vout_ControlChangeCropBorder(vout,
-                                 var_GetInteger(object, "crop-left"),
-                                 var_GetInteger(object, "crop-top"),
-                                 var_GetInteger(object, "crop-right"),
-                                 var_GetInteger(object, "crop-bottom"));
+    snprintf(buf, sizeof (buf), "%"PRIu64"+%"PRIu64"+%"PRIu64"+%"PRIu64,
+             var_GetInteger(object, "crop-left"),
+             var_GetInteger(object, "crop-top"),
+             var_GetInteger(object, "crop-right"),
+             var_GetInteger(object, "crop-bottom"));
+    var_SetString(object, "crop", buf);
+
+    VLC_UNUSED(cmd); VLC_UNUSED(oldval); VLC_UNUSED(data); VLC_UNUSED(newval);
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list