[vlc-commits] demux: avi: PTSToChunk remove useless casts and change type

Francois Cartegnie git at videolan.org
Wed Dec 20 15:37:13 CET 2017


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Dec  8 12:06:28 2017 +0100| [6f42178ca5507c55f4260b8e6d9832f0babd097d] | committer: Francois Cartegnie

demux: avi: PTSToChunk remove useless casts and change type

(cherry picked from commit a17daaa15985b80ce6cffb060d528d578ba9087e)

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

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

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 8e6e37a1e0..57b1238392 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -203,7 +203,7 @@ static inline off_t __EVEN( off_t i )
     return (i & 1) ? i + 1 : i;
 }
 
-static mtime_t AVI_PTSToChunk( avi_track_t *, mtime_t i_pts );
+static int64_t AVI_PTSToChunk( avi_track_t *, mtime_t i_pts );
 static int64_t AVI_PTSToByte ( avi_track_t *, mtime_t i_pts );
 static mtime_t AVI_GetDPTS   ( avi_track_t *, int64_t i_count );
 static mtime_t AVI_GetPTS    ( avi_track_t * );
@@ -1796,15 +1796,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
  * Function to convert pts to chunk or byte
  *****************************************************************************/
 
-static mtime_t AVI_PTSToChunk( avi_track_t *tk, mtime_t i_pts )
+static int64_t AVI_PTSToChunk( avi_track_t *tk, mtime_t i_pts )
 {
     if( !tk->i_scale )
-        return (mtime_t)0;
+        return 0;
 
-    return (mtime_t)((int64_t)i_pts *
-                     (int64_t)tk->i_rate /
-                     (int64_t)tk->i_scale /
-                     (int64_t)CLOCK_FREQ );
+    return i_pts *
+           tk->i_rate /
+           tk->i_scale /
+           CLOCK_FREQ;
 }
 static int64_t AVI_PTSToByte( avi_track_t *tk, mtime_t i_pts )
 {



More information about the vlc-commits mailing list