Commit f420b5a5 authored by Pierre Ynard's avatar Pierre Ynard

rotate: get rid of useless motion field

parent dcc6fc32
...@@ -95,7 +95,6 @@ struct filter_sys_t ...@@ -95,7 +95,6 @@ struct filter_sys_t
int i_cos; int i_cos;
int i_sin; int i_sin;
int i_angle; int i_angle;
bool b_motion;
motion_sensors_t *p_motion; motion_sensors_t *p_motion;
}; };
...@@ -145,8 +144,8 @@ static int Create( vlc_object_t *p_this ) ...@@ -145,8 +144,8 @@ static int Create( vlc_object_t *p_this )
config_ChainParse( p_filter, FILTER_PREFIX, ppsz_filter_options, config_ChainParse( p_filter, FILTER_PREFIX, ppsz_filter_options,
p_filter->p_cfg ); p_filter->p_cfg );
p_sys->b_motion = var_InheritBool( p_filter, FILTER_PREFIX "use-motion" ); p_sys->p_motion = NULL;
if( p_sys->b_motion ) if( var_InheritBool( p_filter, FILTER_PREFIX "use-motion" ) )
{ {
p_sys->p_motion = motion_create( VLC_OBJECT( p_filter ) ); p_sys->p_motion = motion_create( VLC_OBJECT( p_filter ) );
if( p_sys->p_motion == NULL ) if( p_sys->p_motion == NULL )
...@@ -180,7 +179,7 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -180,7 +179,7 @@ static void Destroy( vlc_object_t *p_this )
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
if( p_sys->b_motion ) if( p_sys->p_motion != NULL )
motion_destroy( p_sys->p_motion ); motion_destroy( p_sys->p_motion );
else else
{ {
...@@ -210,7 +209,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) ...@@ -210,7 +209,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
return NULL; return NULL;
} }
if( p_sys->b_motion ) if( p_sys->p_motion != NULL )
{ {
int i_angle = motion_get_angle( p_sys->p_motion ); int i_angle = motion_get_angle( p_sys->p_motion );
if( p_sys->i_angle != i_angle ) if( p_sys->i_angle != i_angle )
...@@ -226,7 +225,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) ...@@ -226,7 +225,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
const int i_sin = p_sys->i_sin; const int i_sin = p_sys->i_sin;
const int i_cos = p_sys->i_cos; const int i_cos = p_sys->i_cos;
if( !p_sys->b_motion ) if( p_sys->p_motion == NULL )
vlc_spin_unlock( &p_sys->lock ); vlc_spin_unlock( &p_sys->lock );
for( int i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) for( int i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
...@@ -375,7 +374,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic ) ...@@ -375,7 +374,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
const int i_line_center = i_visible_lines>>1; const int i_line_center = i_visible_lines>>1;
const int i_col_center = i_visible_pitch>>1; const int i_col_center = i_visible_pitch>>1;
if( p_sys->b_motion ) if( p_sys->p_motion != NULL )
{ {
int i_angle = motion_get_angle( p_sys->p_motion ); int i_angle = motion_get_angle( p_sys->p_motion );
if( p_sys->i_angle != i_angle ) if( p_sys->i_angle != i_angle )
...@@ -391,7 +390,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic ) ...@@ -391,7 +390,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
const int i_sin = p_sys->i_sin; const int i_sin = p_sys->i_sin;
const int i_cos = p_sys->i_cos; const int i_cos = p_sys->i_cos;
if( !p_sys->b_motion ) if( p_sys->p_motion == NULL )
vlc_spin_unlock( &p_sys->lock ); vlc_spin_unlock( &p_sys->lock );
int i_col, i_line; int i_col, i_line;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment