X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=9893cf7fc7318740aef7a8347b89219839e54d28;hb=64a6a87dd4a3fd43665242b8a8b2b35a675a7839;hp=2433ad0fb8bf1a4ca6ee6b82b6526ebfff56cbaa;hpb=ccc093b159c61e811e24f427860b72343185681e;p=dcpomatic.git diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 2433ad0fb..9893cf7fc 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -198,22 +198,27 @@ DCPDecoder::pass_subtitles (ContentTime next) if ((*_reel)->main_subtitle() && (_decode_referenced || !_dcp_content->reference_subtitle())) { int64_t const entry_point = (*_reel)->main_subtitle()->entry_point (); - list subs = (*_reel)->main_subtitle()->asset()->subtitles_during ( + list > subs = (*_reel)->main_subtitle()->asset()->subtitles_during ( dcp::Time (entry_point + frame, vfr, vfr), dcp::Time (entry_point + frame + 1, vfr, vfr), true ); - BOOST_FOREACH (dcp::SubtitleString i, subs) { - list s; - s.push_back (i); - subtitle->emit_text ( - ContentTimePeriod ( - ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i.in().as_seconds ()), - ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i.out().as_seconds ()) - ), - s - ); + BOOST_FOREACH (shared_ptr i, subs) { + shared_ptr is = dynamic_pointer_cast (i); + if (is) { + list s; + s.push_back (*is); + subtitle->emit_text ( + ContentTimePeriod ( + ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i->in().as_seconds ()), + ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i->out().as_seconds ()) + ), + s + ); + } + + /* XXX: image subtitles */ } } }