[vlc-commits] live555: use helper function to convert to vlc_tick_t from floating point seconds

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jun 18 09:40:33 2018 +0200| [0da141b193400c150bbd92a97ec282138906c590] | committer: Steve Lhomme

live555: use helper function to convert to vlc_tick_t from floating point seconds

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

 modules/access/live555.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 8422ad7468..0429d13323 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -1539,11 +1539,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             pi64 = va_arg( args, int64_t * );
             if( p_sys->f_npt_length > 0 )
             {
-                double d_length = p_sys->f_npt_length * (double)CLOCK_FREQ;
-                if( d_length >= INT64_MAX )
+                if( unlikely(p_sys->f_npt_length >= (double)(INT64_MAX / CLOCK_FREQ)) )
                     *pi64 = INT64_MAX;
                 else
-                    *pi64 = (int64_t)d_length;
+                    *pi64 = vlc_tick_from_sec(p_sys->f_npt_length);
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;



More information about the vlc-commits mailing list