summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-05-08 00:15:51 +0100
committerCarl Hetherington <cth@carlh.net>2018-05-08 00:15:51 +0100
commit9facd099fd1b0651af721883ea1ffe5590d4b23b (patch)
tree28044eba95ffb18fc37fc7f9fcb3685a09c49d0f /src
parentcc120b1a461fd91a8ea4553aa2f7fddce5f7f74a (diff)
parent7b03aba8bc4e9df269430d79ce4ee2c6bd5f344c (diff)
Merge branch 'master' of ssh://main.carlh.net/home/carl/git/libdcp
Diffstat (limited to 'src')
-rw-r--r--src/dcp_time.cc20
-rw-r--r--src/verify.cc4
2 files changed, 21 insertions, 3 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc
index f0b7e231..acc9723f 100644
--- a/src/dcp_time.cc
+++ b/src/dcp_time.cc
@@ -39,6 +39,7 @@
#include "dcp_time.h"
#include "exceptions.h"
#include "compose.hpp"
+#include "dcp_assert.h"
#include <boost/algorithm/string.hpp>
#include <boost/optional.hpp>
#include <iostream>
@@ -356,5 +357,22 @@ Time::as_seconds () const
Time
Time::rebase (int tcr_) const
{
- return Time (h, m, s, lrintf (float (e) * tcr_ / tcr), tcr_);
+ long int e_ = lrintf (float (e) * tcr_ / tcr);
+ int s_ = s;
+ if (e_ >= tcr_) {
+ e_ -= tcr_;
+ ++s_;
+ }
+ int m_ = m;
+ if (s_ >= 60) {
+ s_ -= 60;
+ ++m_;
+ }
+ int h_ = h;
+ if (m_ >= 60) {
+ m_ -= 60;
+ ++h_;
+ }
+
+ return Time (h_, m_, s_, e_, tcr_);
}
diff --git a/src/verify.cc b/src/verify.cc
index ab6ba115..87958ed9 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -90,13 +90,13 @@ dcp::verify (vector<boost::filesystem::path> directories, function<void (string,
if (reel->main_picture()) {
stage ("Checking picture asset hash", reel->main_picture()->asset()->file());
if (verify_asset (reel->main_picture(), progress)) {
- notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Picture asset hash is incorrect"));
+ notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Picture asset hash is incorrect."));
}
}
if (reel->main_sound()) {
stage ("Checking sound asset hash", reel->main_sound()->asset()->file());
if (verify_asset (reel->main_sound(), progress)) {
- notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Sound asset hash is incorrect"));
+ notes.push_back (VerificationNote (VerificationNote::VERIFY_ERROR, "Sound asset hash is incorrect."));
}
}
}