From 64a6a87dd4a3fd43665242b8a8b2b35a675a7839 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 8 Jul 2018 00:54:04 +0100 Subject: Fix build with shared_ptr dcp::Subtitle and subclasses. --- src/lib/dcp_decoder.cc | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/lib/dcp_decoder.cc') 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 */ } } } -- cgit v1.2.3