summaryrefslogtreecommitdiff
path: root/src/lib/dcpomatic_time.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-14 14:23:50 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-14 14:23:50 +0100
commit23b69b228ed5b34b59e1789de4bff052bc905ae4 (patch)
treef2c4f3bdfd80d1fe3d3b3dc7800e2d2589693680 /src/lib/dcpomatic_time.cc
parentf509c806965f4a381eec454e7f55a70fd676f302 (diff)
Express trims using ContentTime so that they do not change
when DCP frame rate is changed (#637).
Diffstat (limited to 'src/lib/dcpomatic_time.cc')
-rw-r--r--src/lib/dcpomatic_time.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc
index 4541ced7d..3d4ed1139 100644
--- a/src/lib/dcpomatic_time.cc
+++ b/src/lib/dcpomatic_time.cc
@@ -45,6 +45,36 @@ min (DCPTime a, DCPTime b)
return b;
}
+DCPTime
+max (DCPTime a, DCPTime b)
+{
+ if (a > b) {
+ return a;
+ }
+
+ return b;
+}
+
+ContentTime
+min (ContentTime a, ContentTime b)
+{
+ if (a < b) {
+ return a;
+ }
+
+ return b;
+}
+
+ContentTime
+max (ContentTime a, ContentTime b)
+{
+ if (a > b) {
+ return a;
+ }
+
+ return b;
+}
+
ostream &
operator<< (ostream& s, ContentTime t)
{