From: Carl Hetherington Date: Tue, 20 Sep 2022 19:23:40 +0000 (+0200) Subject: Fix subtitle_file() to find both Interop and SMPTE subtitles. X-Git-Tag: v2.16.27~5 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=dc5e11944a30a9d381dc0e67cf657c5f2cb65845 Fix subtitle_file() to find both Interop and SMPTE subtitles. --- 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 film, string prefix) boost::filesystem::path subtitle_file (shared_ptr 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(); } }