Fix incorrect ISDCF name in some cases (#1118).
authorCarl Hetherington <cth@carlh.net>
Sat, 26 Aug 2017 23:41:38 +0000 (00:41 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 26 Aug 2017 23:41:38 +0000 (00:41 +0100)
ChangeLog
src/lib/film.cc
test/isdcf_name_test.cc

index 598733b40d4329efd96c582aac2f6950da84af12..4cac5de675ba64ffa9e6d1866623e8f15befd6a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-27  Carl Hetherington  <cth@carlh.net>
+
+       * Fix incorrect ISDCF name in some cases (#1118).
+
 2017-08-26  Carl Hetherington  <cth@carlh.net>
 
        * Stop the player looking for encode servers (#1119).
index 0c6a553861d1ea2d09e272aa2f1fe84b8f6e7852..392bb221b021efc1fe16e44c01d53b7aa9df2735 100644 (file)
@@ -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<Content> 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();
                }
        }
 
index cc224aab73e6f39fdd1621769463ceaac554d7b7..f59e02edf41b80fb333d6cca25a06142bcae6d0f 100644 (file)
@@ -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);