diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-29 15:07:17 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-29 15:07:17 +0100 |
| commit | 318a778b1b5c98b79b202dc953ff2ac131371a1b (patch) | |
| tree | 52d05d9927c22842c5047a625e07eb9c92f87cdb /src/lib/dcp_subtitle_decoder.cc | |
| parent | 3802ba3df2ac27d4fabdcbd61b9ed84f6adf5627 (diff) | |
| parent | b289602176a4943233cffb75e8ccac379112420a (diff) | |
Fix merge.
Diffstat (limited to 'src/lib/dcp_subtitle_decoder.cc')
| -rw-r--r-- | src/lib/dcp_subtitle_decoder.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 3c7bffdda..bb2537fc4 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -54,7 +54,7 @@ DCPSubtitleDecoder::pass () list<dcp::SubtitleString> s; s.push_back (*_next); - text_subtitle (s); + text_subtitle (content_time_period (*_next), s); ++_next; return false; @@ -74,11 +74,7 @@ DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) c list<ContentTimePeriod> d; for (list<dcp::SubtitleString>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { - ContentTimePeriod period ( - ContentTime::from_seconds (i->in().as_seconds ()), - ContentTime::from_seconds (i->out().as_seconds ()) - ); - + ContentTimePeriod period = content_time_period (*i); if ((starting && p.contains (period.from)) || (!starting && p.overlaps (period))) { d.push_back (period); } @@ -87,3 +83,11 @@ DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) c return d; } +ContentTimePeriod +DCPSubtitleDecoder::content_time_period (dcp::SubtitleString s) const +{ + return ContentTimePeriod ( + ContentTime::from_seconds (s.in().as_seconds ()), + ContentTime::from_seconds (s.out().as_seconds ()) + ); +} |
