From: Carl Hetherington Date: Sat, 26 Aug 2017 23:41:38 +0000 (+0100) Subject: Fix incorrect ISDCF name in some cases (#1118). X-Git-Tag: v2.11.20~10 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=429094f009920a14353684e83b4628bfac323617;hp=1f95e564b1faec3c12869896101e1188d672a2d6;p=dcpomatic.git Fix incorrect ISDCF name in some cases (#1118). --- diff --git a/ChangeLog b/ChangeLog index 598733b40..4cac5de67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-08-27 Carl Hetherington + + * Fix incorrect ISDCF name in some cases (#1118). + 2017-08-26 Carl Hetherington * Stop the player looking for encode servers (#1119). diff --git a/src/lib/film.cc b/src/lib/film.cc index 0c6a55386..392bb221b 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -669,7 +669,7 @@ Film::isdcf_name (bool if_created_now) const /* XXX: this uses the first bit of content only */ - /* The standard says we don't do this for trailers, for some strange reason */ + /* Interior aspect ratio. The standard says we don't do this for trailers, for some strange reason */ if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) { Ratio const * content_ratio = 0; BOOST_FOREACH (shared_ptr i, content ()) { @@ -685,7 +685,8 @@ Film::isdcf_name (bool if_created_now) const } if (content_ratio && content_ratio != container()) { - d += "-" + content_ratio->isdcf_name(); + /* This needs to be the numeric version of the ratio, and ::id() is close enough */ + d += "-" + content_ratio->id(); } } diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index cc224aab7..f59e02edf 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -93,6 +93,12 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("XSN")); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-133_DE-fr_US-R_4K_DI_20140704_PP_SMPTE_OV"); + /* And it should always be numeric */ + + content->video->set_scale (VideoContentScale (Ratio::from_id ("239"))); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-239_DE-fr_US-R_4K_DI_20140704_PP_SMPTE_OV"); + content->video->set_scale (VideoContentScale (Ratio::from_id ("133"))); + /* Test 3D */ film->set_three_d (true);