diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-08 00:54:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-08 00:54:04 +0100 |
| commit | 64a6a87dd4a3fd43665242b8a8b2b35a675a7839 (patch) | |
| tree | b95db96940d5d5b30405fa1a3a15d0b773ed504b /src/lib/dcp_decoder.cc | |
| parent | ccc093b159c61e811e24f427860b72343185681e (diff) | |
Fix build with shared_ptr dcp::Subtitle and subclasses.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
| -rw-r--r-- | src/lib/dcp_decoder.cc | 27 |
1 files changed, 16 insertions, 11 deletions
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<dcp::SubtitleString> subs = (*_reel)->main_subtitle()->asset()->subtitles_during ( + list<shared_ptr<dcp::Subtitle> > 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<dcp::SubtitleString> 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<dcp::Subtitle> i, subs) { + shared_ptr<dcp::SubtitleString> is = dynamic_pointer_cast<dcp::SubtitleString> (i); + if (is) { + list<dcp::SubtitleString> 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 */ } } } |
