Skip to content
Snippets Groups Projects
Commit 31036ea4 authored by Alexandre Janniaux's avatar Alexandre Janniaux
Browse files

vhs: add intermediate variable to compute threshold

parent 8a44e3b5
No related branches found
No related tags found
No related merge requests found
......@@ -452,10 +452,12 @@ static int vhs_sliding_effect( filter_t *p_filter, picture_t *p_pic_out ) {
if ( abs( p_sys->i_sliding_speed ) < 5 )
p_sys->i_sliding_speed += 1;
/* check if offset is close to 0 and then ready to stop */
if ( abs( p_sys->i_sliding_ofs ) < abs( p_sys->i_sliding_speed
int threshold = p_sys->i_sliding_speed
* p_sys->i_height[Y_PLANE]
* SEC_FROM_VLC_TICK( p_sys->i_cur_time - p_sys->i_last_time ) )
* SEC_FROM_VLC_TICK( p_sys->i_cur_time - p_sys->i_last_time );
/* check if offset is close to 0 and then ready to stop */
if ( abs( p_sys->i_sliding_ofs ) < abs( threshold )
|| abs( p_sys->i_sliding_ofs ) < p_sys->i_height[Y_PLANE] * 100 / 20 ) {
/* reset sliding parameters */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment