summaryrefslogtreecommitdiff
path: root/src/lib/writer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-03-20 10:19:46 +0100
committerCarl Hetherington <cth@carlh.net>2021-03-20 10:19:46 +0100
commitef31a94cd00dcc88fc83093cbc709b5b79acc4b6 (patch)
treea88f220a15d474e0db5757268d9514404b77f22f /src/lib/writer.cc
parent62bfae1511bb8d33ef4cd71b5822bb0b74a5389c (diff)
Tidy up HMSF handling in a few places.
Diffstat (limited to 'src/lib/writer.cc')
-rw-r--r--src/lib/writer.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 035fc2b1d..54e7473e8 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -733,15 +733,14 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp)
}
boost::algorithm::replace_all (text, "$AUDIO", description);
- int h, m, s, fr;
- film()->length().split(film()->video_frame_rate(), h, m, s, fr);
+ auto const hmsf = film()->length().split(film()->video_frame_rate());
string length;
- if (h == 0 && m == 0) {
- length = String::compose("%1s", s);
- } else if (h == 0 && m > 0) {
- length = String::compose("%1m%2s", m, s);
- } else if (h > 0 && m > 0) {
- length = String::compose("%1h%2m%3s", h, m, s);
+ if (hmsf.h == 0 && hmsf.m == 0) {
+ length = String::compose("%1s", hmsf.s);
+ } else if (hmsf.h == 0 && hmsf.m > 0) {
+ length = String::compose("%1m%2s", hmsf.m, hmsf.s);
+ } else if (hmsf.h > 0 && hmsf.m > 0) {
+ length = String::compose("%1h%2m%3s", hmsf.h, hmsf.m, hmsf.s);
}
boost::algorithm::replace_all (text, "$LENGTH", length);