[vlc-commits] vhs: convert vlc_tick_t to seconds explicitly using SEC_FROM_VLC_TICK()

Steve Lhomme git at videolan.org
Thu Jul 5 16:57:51 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 14 09:08:51 2018 +0200| [14463dcdc03b6a2269015b05c89c279b7c03f547] | committer: Steve Lhomme

vhs: convert vlc_tick_t to seconds explicitly using SEC_FROM_VLC_TICK()

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

 modules/video_filter/vhs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/video_filter/vhs.c b/modules/video_filter/vhs.c
index 13c97d05fa..43c56d760f 100644
--- a/modules/video_filter/vhs.c
+++ b/modules/video_filter/vhs.c
@@ -473,7 +473,7 @@ static int vhs_sliding_effect( filter_t *p_filter, picture_t *p_pic_out ) {
         /* 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
              * p_sys->i_height[Y_PLANE]
-             * ( p_sys->i_cur_time - p_sys->i_last_time ) / CLOCK_FREQ )
+             * SEC_FROM_VLC_TICK( p_sys->i_cur_time - p_sys->i_last_time ) )
              || abs( p_sys->i_sliding_ofs ) < p_sys->i_height[Y_PLANE] * 100 / 20 ) {
 
             /* reset sliding parameters */
@@ -486,8 +486,7 @@ static int vhs_sliding_effect( filter_t *p_filter, picture_t *p_pic_out ) {
     /* update offset */
     p_sys->i_sliding_ofs = MOD( p_sys->i_sliding_ofs
                                 + p_sys->i_sliding_speed * p_sys->i_height[Y_PLANE]
-                                * ( p_sys->i_cur_time - p_sys->i_last_time)
-                                / CLOCK_FREQ,
+                                * SEC_FROM_VLC_TICK( p_sys->i_cur_time - p_sys->i_last_time),
                                 p_sys->i_height[Y_PLANE] * 100 );
 
     return vhs_sliding_effect_apply( p_filter, p_pic_out );



More information about the vlc-commits mailing list