- if (boost::filesystem::is_directory (f->content_path()) || f->content_type() == STILL) {
- /* A single image file, or a directory of them */
- return Decoders (
- shared_ptr<VideoDecoder> (new ImageMagickDecoder (f, o, j)),
- shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o, j))
- );
+ shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (content);
+ if (fc) {
+ return shared_ptr<Decoder> (new FFmpegDecoder (fc, log, fast));
+ }
+
+ shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (content);
+ if (dc) {
+ return shared_ptr<Decoder> (new DCPDecoder (dc, log, fast));
+ }
+
+ shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (content);
+ if (ic) {
+ return shared_ptr<Decoder> (new ImageDecoder (ic, log));
+ }
+
+ shared_ptr<const TextSubtitleContent> rc = dynamic_pointer_cast<const TextSubtitleContent> (content);
+ if (rc) {
+ return shared_ptr<Decoder> (new TextSubtitleDecoder (rc, log));
+ }
+
+ shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (content);
+ if (dsc) {
+ return shared_ptr<Decoder> (new DCPSubtitleDecoder (dsc, log));