Fix font_id errors with files decoded by FFmpeg which have subtitles.
authorCarl Hetherington <cth@carlh.net>
Sat, 9 Jul 2022 21:08:56 +0000 (23:08 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Jul 2022 10:22:11 +0000 (12:22 +0200)
I'm not sure if this goes far enough - it seems impossible to find all
the font IDs used in a FFmpeg file without scanning it.  I don't know
if (for example) SSA-format font IDs make it through to DoM when decoded
by FFmpeg.

src/lib/ffmpeg_content.cc
test/subtitle_font_id_test.cc

index c791309ad04dae2280ce31b4e6146e4385b3ace8..4bc88e1e4937ca2e896101ae8903c0539893cd7e 100644 (file)
@@ -320,6 +320,7 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
                        text.clear ();
                        text.push_back (make_shared<TextContent>(this, TextType::OPEN_SUBTITLE, TextType::UNKNOWN));
                        _subtitle_stream = _subtitle_streams.front ();
+                       text.front()->add_font(make_shared<dcpomatic::Font>(""));
                }
        }
 
index 792e8eb556a65f448a15a5751b1b7e0608d3f0ce..51bccc70a78a3c9ed724e6e6444eb0a1e2db6592 100644 (file)
@@ -90,3 +90,13 @@ BOOST_AUTO_TEST_CASE(make_dcp_with_subs_from_smpte_dcp)
        make_and_verify_dcp(film);
 }
 
+
+BOOST_AUTO_TEST_CASE(make_dcp_with_subs_from_mkv)
+{
+       auto subs = content_factory(TestPaths::private_data() / "clapperboard_with_subs.mkv");
+       auto film = new_test_film2("make_dcp_with_subs_from_mkv", subs);
+       subs[0]->text.front()->set_use(true);
+       subs[0]->text.front()->set_language(dcp::LanguageTag("en-US"));
+       make_and_verify_dcp(film, { dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K });
+}
+