Fix seek with respect to video/audio frame boundary alignment.
[dcpomatic.git] / src / lib / util.cc
index d5a07192c9f2694842b37161a88a878e71e216c8..381c47a9ae606253a7207a492351965987638c58 100644 (file)
@@ -915,3 +915,10 @@ fit_ratio_within (float ratio, libdcp::Size full_frame)
        
        return libdcp::Size (full_frame.width, rint (full_frame.width / ratio));
 }
+
+DCPTime
+time_round_up (DCPTime t, DCPTime nearest)
+{
+       DCPTime const a = t + nearest - 1;
+       return a - (a % nearest);
+}