Merge master; fix crash on new film.
[dcpomatic.git] / src / tools / servomatictest.cc
index 5e1cf49b4b0b1e04faff88718f58801948492173..af176ac18e6b02ea011cc526bd3a4a581b49e128 100644 (file)
 #include "scaler.h"
 #include "server.h"
 #include "dcp_video_frame.h"
-#include "options.h"
 #include "decoder.h"
 #include "exceptions.h"
 #include "scaler.h"
 #include "log.h"
-#include "decoder_factory.h"
 #include "video_decoder.h"
+#include "player.h"
 
 using std::cout;
 using std::cerr;
@@ -146,22 +145,19 @@ 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));
 
-       DecodeOptions opt;
-       opt.decode_audio = false;
-       opt.decode_subtitles = true;
-       opt.video_sync = true;
+       shared_ptr<Player> player = film->player ();
+       player->disable_audio ();
 
-       Decoders decoders = decoder_factory (film, opt);
        try {
-               decoders.video->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 = decoders.video->pass ();
+                       done = player->pass ();
                }
        } catch (std::exception& e) {
                cerr << "Error: " << e.what() << "\n";