Merge master into direct-mxf.
[dcpomatic.git] / src / lib / decoder_factory.cc
index b2118ef744832649f6a176223153dbc4326b83b3..c4d818f497f6d7eec7f173eea9fa445d9a666f21 100644 (file)
@@ -26,6 +26,7 @@
 #include "imagemagick_decoder.h"
 #include "film.h"
 #include "external_audio_decoder.h"
+#include "decoder_factory.h"
 
 using std::string;
 using std::pair;
@@ -33,23 +34,23 @@ using std::make_pair;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 
-pair<shared_ptr<VideoDecoder>, shared_ptr<AudioDecoder> >
+Decoders
 decoder_factory (
-       shared_ptr<Film> f, shared_ptr<const Options> o, Job* j
+       shared_ptr<Film> f, DecodeOptions o, Job* j
        )
 {
        if (boost::filesystem::is_directory (f->content_path()) || f->content_type() == STILL) {
                /* A single image file, or a directory of them */
-               return make_pair (
+               return Decoders (
                        shared_ptr<VideoDecoder> (new ImageMagickDecoder (f, o, j)),
-                       shared_ptr<AudioDecoder> ()
+                       shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o, j))
                        );
        }
 
        shared_ptr<FFmpegDecoder> fd (new FFmpegDecoder (f, o, j));
        if (f->use_content_audio()) {
-               return make_pair (fd, fd);
+               return Decoders (fd, fd);
        }
 
-       return make_pair (fd, shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o, j)));
+       return Decoders (fd, shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o, j)));
 }