Tidy up test film naming.
[dcpomatic.git] / src / lib / copy_from_dvd_job.cc
index b82169ad14fd3a81fe79ed8d247cbec935435661..e087180728bd8767b39ddc299c8b51c55f102f09 100644 (file)
@@ -27,6 +27,7 @@
 #include "copy_from_dvd_job.h"
 #include "film_state.h"
 #include "dvd.h"
+#include "cross.h"
 
 using namespace std;
 using namespace boost;
@@ -34,8 +35,8 @@ using namespace boost;
 /** @param fs FilmState for the film to write DVD data into.
  *  @param l Log that we can write to.
  */
-CopyFromDVDJob::CopyFromDVDJob (shared_ptr<const FilmState> fs, Log* l)
-       : Job (fs, shared_ptr<Options> (), l)
+CopyFromDVDJob::CopyFromDVDJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
+       : Job (fs, l, req)
 {
 
 }
@@ -58,7 +59,7 @@ CopyFromDVDJob::run ()
                set_state (FINISHED_ERROR);
        }
 
-       vector<uint64_t> const t = dvd_titles (dvd);
+       list<DVDTitle> const t = dvd_titles (dvd);
        if (t.empty ()) {
                set_error ("no titles found on DVD");
                set_state (FINISHED_ERROR);
@@ -66,10 +67,10 @@ CopyFromDVDJob::run ()
 
        int longest_title = 0;
        uint64_t longest_size = 0;
-       for (vector<int>::size_type i = 0; i < t.size(); ++i) {
-               if (longest_size < t[i]) {
-                       longest_size = t[i];
-                       longest_title = i;
+       for (list<DVDTitle>::const_iterator i = t.begin(); i != t.end(); ++i) {
+               if (longest_size < i->size) {
+                       longest_size = i->size;
+                       longest_title = i->number;
                }
        }