[vlc-commits] demux:avi: convert the frames in microseconds to ticks using VLC_TICK_FROM_US()

Steve Lhomme git at videolan.org
Tue Jul 3 15:30:51 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul  3 15:13:54 2018 +0200| [ec5664cde7673c032ed746522954fc0369f53c9e] | committer: Steve Lhomme

demux:avi: convert the frames in microseconds to ticks using VLC_TICK_FROM_US()

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

 modules/demux/avi/avi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 6396205bc2..fbc29ccad6 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -798,8 +798,8 @@ aviindex:
             i_idx_totalframes = __MAX(i_idx_totalframes, tk->idx.i_size);
     }
     if( i_idx_totalframes != p_avih->i_totalframes &&
-        p_sys->i_length < (vlc_tick_t)p_avih->i_totalframes *
-                          (vlc_tick_t)p_avih->i_microsecperframe /
+        p_sys->i_length < VLC_TICK_FROM_US( p_avih->i_totalframes *
+                                            p_avih->i_microsecperframe ) /
                           CLOCK_FREQ )
     {
         msg_Warn( p_demux, "broken or missing index, 'seek' will be "
@@ -872,8 +872,8 @@ aviindex:
             int64_t i_track_length =
                 tk->idx.p_entry[tk->idx.i_size-1].i_length +
                 tk->idx.p_entry[tk->idx.i_size-1].i_lengthtotal;
-            vlc_tick_t i_length = (vlc_tick_t)p_avih->i_totalframes *
-                               (vlc_tick_t)p_avih->i_microsecperframe;
+            vlc_tick_t i_length = VLC_TICK_FROM_US( p_avih->i_totalframes *
+                                                    p_avih->i_microsecperframe );
 
             if( i_length == 0 )
             {



More information about the vlc-commits mailing list