Merge master.
[dcpomatic.git] / src / tools / servomatictest.cc
index 3d847d690f15fa4d2e8230dd3ed0b55ff4344dfc..88974eed731e6be7334a6dd0ab57d473dbb15583 100644 (file)
@@ -33,7 +33,7 @@
 #include "scaler.h"
 #include "log.h"
 #include "video_decoder.h"
-#include "playlist.h"
+#include "player.h"
 
 using std::cout;
 using std::cerr;
@@ -46,7 +46,7 @@ static shared_ptr<FileLog> log_ (new FileLog ("servomatictest.log"));
 static int frame = 0;
 
 void
-process_video (shared_ptr<Image> image, bool, shared_ptr<Subtitle> sub)
+process_video (shared_ptr<const Image> image, bool, shared_ptr<Subtitle> sub)
 {
        shared_ptr<DCPVideoFrame> local (
                new DCPVideoFrame (
@@ -145,19 +145,20 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
-       dvdomatic_setup ();
+       dcpomatic_setup ();
 
        server = new ServerDescription (server_host, 1);
-       shared_ptr<Film> film (new Film (film_dir, true));
+       shared_ptr<Film> film (new Film (film_dir));
+       film->read_metadata ();
 
-       shared_ptr<Playlist> playlist = film->playlist ();
-       playlist->disable_audio ();
+       shared_ptr<Player> player = film->player ();
+       player->disable_audio ();
 
        try {
-               playlist->Video.connect (boost::bind (process_video, _1, _2, _3));
+               player->Video.connect (boost::bind (process_video, _1, _2, _3));
                bool done = false;
                while (!done) {
-                       done = playlist->pass ();
+                       done = player->pass ();
                }
        } catch (std::exception& e) {
                cerr << "Error: " << e.what() << "\n";