- /* SndfileContent */
- shared_ptr<const SndfileContent> sc = dynamic_pointer_cast<const SndfileContent> (i);
- if (sc) {
- decoder.reset (new SndfileDecoder (sc, _fast));
-
- /* Work out a FrameRateChange for the best overlap video for this content */
- DCPTime best_overlap_t;
- shared_ptr<VideoContent> best_overlap;
- BOOST_FOREACH (shared_ptr<Content> j, _playlist->content ()) {
- shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (j);
- if (!vc) {
- continue;
- }
-
- DCPTime const overlap = min (vc->end(), i->end()) - max (vc->position(), i->position());
- if (overlap > best_overlap_t) {
- best_overlap = vc;
- best_overlap_t = overlap;
- }
- }
-
- if (best_overlap) {
- frc = FrameRateChange (best_overlap->video_frame_rate(), _film->video_frame_rate ());
- } else {
- /* No video overlap; e.g. if the DCP is just audio */
- frc = FrameRateChange (_film->video_frame_rate(), _film->video_frame_rate ());
- }
- }
-
- /* It's questionable whether subtitle content should have a video frame rate; perhaps
- it should be assumed that any subtitle content has been prepared at the same rate
- as simultaneous video content (like we do with audio).
- */
-
- /* SubRipContent */
- shared_ptr<const SubRipContent> rc = dynamic_pointer_cast<const SubRipContent> (i);
- if (rc) {
- decoder.reset (new SubRipDecoder (rc));
- frc = FrameRateChange (rc->subtitle_video_frame_rate(), _film->video_frame_rate());
- }
-
- /* DCPSubtitleContent */
- shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (i);
- if (dsc) {
- decoder.reset (new DCPSubtitleDecoder (dsc));
- frc = FrameRateChange (dsc->subtitle_video_frame_rate(), _film->video_frame_rate());