summaryrefslogtreecommitdiff
path: root/src/dcp_time.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-11 16:41:15 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-11 16:41:15 +0000
commit8951dd59e685b112e28a0d72edcabd4524e0289d (patch)
tree7358baf5c3554dd9e5673c83ef156c5471161717 /src/dcp_time.cc
parent78db20ae144115e6eaea6e7bd239e0ec06baf082 (diff)
Fix uninitialised variable.
Diffstat (limited to 'src/dcp_time.cc')
-rw-r--r--src/dcp_time.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc
index 93c12a06..c3c60f66 100644
--- a/src/dcp_time.cc
+++ b/src/dcp_time.cc
@@ -34,13 +34,8 @@ using namespace boost;
using namespace dcp;
Time::Time (int frame, int frames_per_second, int tcr_)
- : h (0)
- , m (0)
- , s (0)
- , e (0)
- , tcr (tcr_)
{
- set (double (frame) / frames_per_second, tcr);
+ set (double (frame) / frames_per_second, tcr_);
}
Time::Time (double seconds)
@@ -59,11 +54,15 @@ Time::set (double seconds, int tcr_)
if (s >= 60) {
m = s / 60;
s -= m * 60;
+ } else {
+ m = 0;
}
if (m >= 60) {
h = m / 60;
m -= h * 60;
+ } else {
+ h = 0;
}
}