summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-09-20 21:23:40 +0200
committerCarl Hetherington <cth@carlh.net>2022-09-20 21:24:16 +0200
commitdc5e11944a30a9d381dc0e67cf657c5f2cb65845 (patch)
tree539dbf98fb2346fae65c9e6501426f5b5bdc8e8a /test
parent49fbf8b284f93aff01d013ba5a01035b2d9f31df (diff)
Fix subtitle_file() to find both Interop and SMPTE subtitles.
Diffstat (limited to 'test')
-rw-r--r--test/test.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/test.cc b/test/test.cc
index 9261ce43b..f1fd40fb7 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -836,13 +836,9 @@ dcp_file (shared_ptr<const Film> film, string prefix)
boost::filesystem::path
subtitle_file (shared_ptr<Film> film)
{
- for (auto i: boost::filesystem::directory_iterator(film->directory().get() / film->dcp_name (false))) {
- if (boost::filesystem::is_directory(i.path())) {
- for (auto j: boost::filesystem::directory_iterator(i.path())) {
- if (boost::algorithm::starts_with(j.path().leaf().string(), "sub_")) {
- return j.path();
- }
- }
+ for (auto i: boost::filesystem::recursive_directory_iterator(film->directory().get() / film->dcp_name(false))) {
+ if (boost::algorithm::starts_with(i.path().leaf().string(), "sub_")) {
+ return i.path();
}
}