]> git.sesse.net Git - vlc/blobdiff - modules/control/motion.c
Tab and trailing space police.
[vlc] / modules / control / motion.c
index 81511cbb2389472ace04977f2411d9c46f9d0893..4541551eea7d92a72612704d4a053065d370f5b2 100644 (file)
@@ -28,8 +28,8 @@
 #include <string.h>
 
 #include <vlc/vlc.h>
-#include <vlc/intf.h>
-#include <vlc/vout.h>
+#include <vlc_interface.h>
+#include <vlc_vout.h>
 
 #ifdef HAVE_UNISTD_H
 #    include <unistd.h>
@@ -120,11 +120,6 @@ int Open ( vlc_object_t *p_this )
 
     p_intf->p_sys->b_use_rotate = config_GetInt( p_intf, "motion-use-rotate" );
 
-    if( p_intf->p_sys->b_use_rotate )
-    {
-        var_Create( p_intf->p_libvlc, "rotate_angle", VLC_VAR_INTEGER );
-    }
-
     return VLC_SUCCESS;
 }
 
@@ -150,7 +145,7 @@ static void RunIntf( intf_thread_t *p_intf )
 #define LOW_THRESHOLD 80
 #define HIGH_THRESHOLD 100
         vout_thread_t *p_vout;
-        char *psz_filter, *psz_type;
+        const char *psz_filter, *psz_type;
         vlc_bool_t b_change = VLC_FALSE;
 
         /* Wait a bit, get orientation, change filter if necessary */
@@ -162,9 +157,15 @@ static void RunIntf( intf_thread_t *p_intf )
         {
             if( i_oldx != i_x )
             {
-                var_SetInteger( p_intf->p_libvlc, "rotate_angle",
-                            ((360+i_x/2)%360) );
-                i_oldx = i_x;
+                /* TODO: cache object pointer */
+                vlc_object_t *p_obj =
+                vlc_object_find_name( p_intf->p_libvlc, "rotate", FIND_CHILD );
+                if( p_obj )
+                {
+                    var_SetInteger( p_obj, "rotate-angle",((360+i_x/2)%360) );
+                    i_oldx = i_x;
+                    vlc_object_release( p_obj );
+                }
             }
             continue;
         }