From ef31a94cd00dcc88fc83093cbc709b5b79acc4b6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 20 Mar 2021 10:19:46 +0100 Subject: Tidy up HMSF handling in a few places. --- src/lib/writer.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/lib/writer.cc') 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); -- cgit v1.2.3