Bump libcxml for Centos build fix.
[libdcp.git] / src / dcp_time.cc
index ccedd8ce3efcbac17a5f419fac7bbcede60f867d..d597e3dc203e765e10e2d20ec9331a7e0de637f1 100644 (file)
 #include <iostream>
 #include <vector>
 #include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
 #include <cmath>
 #include "dcp_time.h"
 #include "exceptions.h"
+#include "raw_convert.h"
 
 using namespace std;
 using namespace boost;
@@ -44,15 +44,13 @@ Time::Time (int frame, int frames_per_second)
 
 Time::Time (int64_t ticks)
 {
-       h = ticks / (60 * 60 * 25);
-       ticks -= int64_t (h) * 60 * 60 * 25;
-       m = ticks / (60 * 25);
-       ticks -= int64_t (m) * 60 * 25;
-       s = ticks / 25;
-       ticks -= int64_t (s) * 25;
+       h = ticks / (60 * 60 * 250);
+       ticks -= int64_t (h) * 60 * 60 * 250;
+       m = ticks / (60 * 250);
+       ticks -= int64_t (m) * 60 * 250;
+       s = ticks / 250;
+       ticks -= int64_t (s) * 250;
        t = ticks;
-
-       std::cout << "Hello: " << h << " " << m << " " << s << " " << t << "\n";
 }
 
 void
@@ -80,10 +78,10 @@ Time::Time (string time)
                boost::throw_exception (DCPReadError ("unrecognised time specification"));
        }
        
-       h = lexical_cast<int> (b[0]);
-       m = lexical_cast<int> (b[1]);
-       s = lexical_cast<int> (b[2]);
-       t = lexical_cast<int> (b[3]);
+       h = raw_convert<int> (b[0]);
+       m = raw_convert<int> (b[1]);
+       s = raw_convert<int> (b[2]);
+       t = raw_convert<int> (b[3]);
 }
 
 bool
@@ -248,6 +246,6 @@ Time::to_string () const
 int64_t
 Time::to_ticks () const
 {
-       return int64_t(t) + int64_t(s) * 25 + int64_t(m) * 60 * 25 + int64_t(h) * 60 * 60 * 25;
+       return int64_t(t) + int64_t(s) * 250 + int64_t(m) * 60 * 250 + int64_t(h) * 60 * 60 * 250;
 }