diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-09 20:10:09 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-09 20:10:09 +0100 |
| commit | fa2c49210c9fcf0f26205927aec0aceb13ca69ce (patch) | |
| tree | 3f4c060d5876929d58e3b02b5220121e558e16c4 /test/test.cc | |
| parent | 35928d882377e35db4eba43fb0f5882e81fa1a29 (diff) | |
Don't write multiple <LoadFont> tags to Interop subtitles (#1273).
Diffstat (limited to 'test/test.cc')
| -rw-r--r-- | test/test.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test.cc b/test/test.cc index c7a8bbed6..93cd5ee14 100644 --- a/test/test.cc +++ b/test/test.cc @@ -481,3 +481,27 @@ dcp_file (shared_ptr<const Film> film, string prefix) BOOST_REQUIRE (i != boost::filesystem::directory_iterator()); return i->path(); } + +boost::filesystem::path +subtitle_file (shared_ptr<Film> film) +{ + for ( + boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (film->directory().get() / film->dcp_name (false)); + i != boost::filesystem::directory_iterator (); + ++i) { + + if (boost::filesystem::is_directory (i->path ())) { + for ( + boost::filesystem::directory_iterator j = boost::filesystem::directory_iterator (i->path ()); + j != boost::filesystem::directory_iterator (); + ++j) { + + if (boost::algorithm::starts_with (j->path().leaf().string(), "sub_")) { + return j->path(); + } + } + } + } + + BOOST_REQUIRE (false); +} |
