[vlc-commits] demux:adaptive: replace hardcoded CLOCK_FREQ equivalent

Steve Lhomme git at videolan.org
Fri Jul 6 09:20:44 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jun 11 13:43:06 2018 +0200| [bf7d125849cb8b119ae2fcd32cc0e47c0979d737] | committer: Steve Lhomme

demux:adaptive: replace hardcoded CLOCK_FREQ equivalent

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

 modules/demux/adaptive/Time.hpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/adaptive/Time.hpp b/modules/demux/adaptive/Time.hpp
index 2d9638e334..3dea66f44b 100644
--- a/modules/demux/adaptive/Time.hpp
+++ b/modules/demux/adaptive/Time.hpp
@@ -35,14 +35,14 @@ class Timescale
             if( !scale ) return 0;
             stime_t v = t / scale;
             stime_t r = t % scale;
-            return v * 1000000 + r * 1000000 / scale;
+            return v * CLOCK_FREQ + r * CLOCK_FREQ / scale;
         }
 
         stime_t ToScaled(vlc_tick_t t) const
         {
-            vlc_tick_t v = t / 1000000;
-            vlc_tick_t r = t % 1000000;
-            return v * scale + r * scale / 1000000;
+            int64_t v = t / CLOCK_FREQ;
+            int64_t r = t % CLOCK_FREQ;
+            return v * scale + r * scale / CLOCK_FREQ;
         }
 
         bool isValid() const { return !!scale; }



More information about the vlc-commits mailing list