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

Francois Cartegnie git at videolan.org
Fri Dec 8 16:51:47 CET 2017


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

demux: avi: PTSToChunk remove useless casts and change type

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

 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 1e26116978..01153930d4 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -200,7 +200,7 @@ struct demux_sys_t
 
 #define __EVEN(x) (((x) & 1) ? (x) + 1 : (x))
 
-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 * );
@@ -1790,15 +1790,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