Add discouraging hint for MPEG2 (#2821).
authorCarl Hetherington <cth@carlh.net>
Tue, 18 Jun 2024 15:28:20 +0000 (17:28 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 18 Jun 2024 15:28:20 +0000 (17:28 +0200)
src/lib/hints.cc
src/lib/hints.h
test/hints_test.cc

index e7a393103fc07bc9d5a802dd2c63969b2709fa08..1114d0acb22fab17302f155907cf076ff58aeac5 100644 (file)
@@ -263,6 +263,15 @@ Hints::check_interop ()
 }
 
 
+void
+Hints::check_video_encoding()
+{
+       if (film()->video_encoding() == VideoEncoding::MPEG2) {
+               hint(_("The vast majority of cinemas in Europe, Australasia and North America expect DCPs encoded with JPEG2000 rather than MPEG2.  Make sure that your cinema really wants an old-style MPEG2 DCP."));
+       }
+}
+
+
 void
 Hints::check_big_font_files ()
 {
@@ -463,6 +472,7 @@ try
 
        check_certificates ();
        check_interop ();
+       check_video_encoding();
        check_big_font_files ();
        check_few_audio_channels ();
        check_upmixers ();
index a46678af8a357ff918f5dbfbbfa77b46dfa64ddf..9e94f210f5bc7b93835691e192b6c8cd74a91e20 100644 (file)
@@ -69,6 +69,7 @@ private:
 
        void check_certificates ();
        void check_interop ();
+       void check_video_encoding();
        void check_big_font_files ();
        void check_few_audio_channels ();
        void check_upmixers ();
index 56a0964c4c49f3803c87f2b71ba3d320aa4e1828..1b510f9e73b091abfd500fe0a6389461251e86f6 100644 (file)
@@ -296,3 +296,16 @@ BOOST_AUTO_TEST_CASE (hints_certificate_validity)
                );
 }
 
+
+BOOST_AUTO_TEST_CASE(hints_mpeg2)
+{
+       auto film = new_test_film("hints_certificate_validity");
+       film->set_video_encoding(VideoEncoding::MPEG2);
+       auto hints = get_hints(film);
+       BOOST_REQUIRE_EQUAL(hints.size(), 1U);
+       BOOST_CHECK_EQUAL(
+               hints[0],
+               "The vast majority of cinemas in Europe, Australasia and North America expect DCPs "
+               "encoded with JPEG2000 rather than MPEG2.  Make sure that your cinema really wants an old-style MPEG2 DCP."
+               );
+}