]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/crop.c
Merge branch 'master' into lpcm_encoder
[vlc] / modules / video_filter / crop.c
index b3342173143b1760d9008c5ada5b55f10b9a1202..497a46b0a3029eceeed8b748cdd03214024ff425 100644 (file)
@@ -36,8 +36,6 @@
 #include <vlc_vout.h>
 #include <vlc_dialog.h>
 
-#include "filter_common.h"
-
 #define BEST_AUTOCROP 1
 #ifdef BEST_AUTOCROP
     #define RATIO_MAX 15000  // 10*4/3 for a 360
@@ -831,14 +829,14 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
     vout_thread_t *p_vout = p_data;
     VLC_UNUSED(p_this); VLC_UNUSED(oldval);
 
+    if( !strcmp( psz_var, "mouse-button-down" ) )
+        return var_SetChecked( p_vout, psz_var, VLC_VAR_INTEGER, newval );
+
     /* Translate the mouse coordinates
      * FIXME missing lock */
-    if( !strcmp( psz_var, "mouse-x" ) )
-        newval.i_int += p_vout->p_sys->i_x;
-    else if( !strcmp( psz_var, "mouse-y" ) )
-        newval.i_int += p_vout->p_sys->i_y;
-
-    return var_Set( p_vout, psz_var, newval );
+    newval.coords.x += p_vout->p_sys->i_x;
+    newval.coords.y += p_vout->p_sys->i_y;
+    return var_SetChecked( p_vout, psz_var, VLC_VAR_COORDS, newval );
 }
 
 #ifdef BEST_AUTOCROP