[vlc-commits] demux:avi: do less operations if the i_scale is zero

Steve Lhomme git at videolan.org
Wed Sep 19 15:46:27 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun  6 15:42:56 2018 +0200| [de42a800ab909f173586c062d782d8eefe5fcb7d] | committer: Steve Lhomme

demux:avi: do less operations if the i_scale is zero

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

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

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 335fbccfe1..181b10d3d4 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -1740,10 +1740,12 @@ static vlc_tick_t AVI_GetDPTS( avi_track_t *tk, int64_t i_count )
     vlc_tick_t i_dpts = 0;
 
     if( !tk->i_rate )
-        return i_dpts;
+        return 0;
+
+    if( !tk->i_scale )
+        return 0;
 
-    if( tk->i_scale )
-        i_dpts = AVI_Rescale( vlc_tick_from_sec( i_count ), tk->i_rate, tk->i_scale );
+    i_dpts = AVI_Rescale( CLOCK_FREQ * i_count, tk->i_rate, tk->i_scale );
 
     if( tk->i_samplesize )
     {



More information about the vlc-commits mailing list