diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-07-09 23:08:56 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-07-11 12:22:11 +0200 |
| commit | ebf89c5e6200b65e5cc48bb7b3af23ab68ede749 (patch) | |
| tree | f906abac541a783664640af07098bc7f058cc7c7 | |
| parent | b1e22dff981fb86ae04b12bb5a064e61030793a8 (diff) | |
Fix font_id errors with files decoded by FFmpeg which have subtitles.
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.
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 1 | ||||
| -rw-r--r-- | test/subtitle_font_id_test.cc | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index c791309ad..4bc88e1e4 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -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>("")); } } diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc index 792e8eb55..51bccc70a 100644 --- a/test/subtitle_font_id_test.cc +++ b/test/subtitle_font_id_test.cc @@ -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 }); +} + |
