Merge branch '2.0' of git.carlh.net:git/dcpomatic into 2.0
[dcpomatic.git] / src / tools / dcpomatic_cli.cc
index 8c33b7d83a983f4917bf98ee413bf0cf7186d635..44abf4116d01403fc56963eee4d2a112d000a705 100644 (file)
@@ -139,6 +139,17 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
+       ContentList content = film->content ();
+       for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
+               vector<boost::filesystem::path> paths = (*i)->paths ();
+               for (vector<boost::filesystem::path>::const_iterator j = paths.begin(); j != paths.end(); ++j) {
+                       if (!boost::filesystem::exists (*j)) {
+                               cerr << argv[0] << ": content file " << *j << " not found.\n";
+                               exit (EXIT_FAILURE);
+                       }
+               }
+       }
+               
        cout << "\nMaking DCP for " << film->name() << "\n";
 
        film->make_dcp ();
@@ -166,9 +177,7 @@ main (int argc, char* argv[])
                        if (progress) {
                                cout << (*i)->name() << ": ";
                                
-                               float const p = (*i)->progress ();
-                               
-                               if (p >= 0) {
+                               if ((*i)->progress ()) {
                                        cout << (*i)->status() << "                         \n";
                                } else {
                                        cout << ": Running           \n";
@@ -207,6 +216,8 @@ main (int argc, char* argv[])
           indirectly holding onto codecs.
        */
        JobManager::drop ();
+
+       ServerFinder::drop ();
        
        return error ? EXIT_FAILURE : EXIT_SUCCESS;
 }