Fix tests.
[dcpomatic.git] / src / lib / dcp_content.cc
index ac9f828996d286c20b15f849ff378dd5e5921035..419ffe69c4b7eef417598ee34d01fad25274f9d1 100644 (file)
@@ -150,16 +150,7 @@ DCPContent::DCPContent (cxml::ConstNodePtr node, int version)
 void
 DCPContent::read_directory (boost::filesystem::path p)
 {
-       LOG_GENERAL ("DCPContent::read_directory reads %1", p.string());
-       for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
-               if (boost::filesystem::is_regular_file (i->path())) {
-                       LOG_GENERAL ("Inside there's regular file %1", i->path().string());
-                       add_path (i->path());
-               } else if (boost::filesystem::is_directory (i->path ())) {
-                       LOG_GENERAL ("Inside there's directory %1", i->path().string());
-                       read_directory (i->path());
-               }
-       }
+       read_sub_directory (p);
 
        bool have_assetmap = false;
        BOOST_FOREACH (boost::filesystem::path i, paths()) {
@@ -173,6 +164,21 @@ DCPContent::read_directory (boost::filesystem::path p)
        }
 }
 
+void
+DCPContent::read_sub_directory (boost::filesystem::path p)
+{
+       LOG_GENERAL ("DCPContent::read_sub_directory reads %1", p.string());
+       for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
+               if (boost::filesystem::is_regular_file (i->path())) {
+                       LOG_GENERAL ("Inside there's regular file %1", i->path().string());
+                       add_path (i->path());
+               } else if (boost::filesystem::is_directory (i->path ())) {
+                       LOG_GENERAL ("Inside there's directory %1", i->path().string());
+                       read_sub_directory (i->path());
+               }
+       }
+}
+
 void
 DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 {