Fix fl indication in ISDCF name.
authorCarl Hetherington <cth@carlh.net>
Sat, 11 Jan 2025 22:28:22 +0000 (23:28 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 12 Jan 2025 01:06:50 +0000 (02:06 +0100)
Maybe I missed it, or maybe it changed, but apparently 3.5fl is supposed
to be written as 35fl in the name.

src/lib/film.cc
test/isdcf_name_test.cc

index 4c3fd61a523edc6f2c22e61b083e118936ce729c..7b6b46ab939a449ba6991dd01a30bf347662941e 100644 (file)
@@ -964,10 +964,7 @@ Film::isdcf_name (bool if_created_now) const
        }
 
        if (_luminance) {
-               auto fl = _luminance->value_in_foot_lamberts();
-               char buffer[64];
-               snprintf (buffer, sizeof(buffer), "%.1f", fl);
-               isdcf_name += String::compose("-%1fl", buffer);
+               isdcf_name += fmt::format("-{}fl", std::round(_luminance->value_in_foot_lamberts() * 10));
        }
 
        if (video_frame_rate() != 24) {
index 40626621f2106c69210ee63c8171b9b722517dab..bd2289138e2f3f090b9f9976e787d758b2707066 100644 (file)
@@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        film->set_chain (string("MyChain"));
        film->set_luminance (dcp::Luminance(4.5, dcp::Luminance::Unit::FOOT_LAMBERT));
        film->set_video_frame_rate (48);
-       BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-Temp-Pre-RedBand-MyChain-2D-4.5fl-48_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV");
+       BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-Temp-Pre-RedBand-MyChain-2D-45fl-48_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV");
 
        /* Test a name which is already in camelCase */