diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-11 16:46:12 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-11 16:46:12 +0000 |
| commit | 6649b8c96ebaa04cd3596387c24e9567504fd2a3 (patch) | |
| tree | 7bd4a2d48cf34a3f71beba06ab7c3f4166c6d660 /src/lib | |
| parent | 5ee4ac547e22fd9e4aadc35617ca43d02667ccb1 (diff) | |
Fix call to dcp::Time constructor.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/subrip_decoder.cc | 7 | ||||
| -rw-r--r-- | src/lib/writer.cc | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc index 0ef747cf1..22f7b6ba4 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/subrip_decoder.cc @@ -24,6 +24,7 @@ using std::list; using std::vector; using std::string; +using std::cout; using boost::shared_ptr; using boost::optional; @@ -64,8 +65,8 @@ SubRipDecoder::pass () j->italic, dcp::Colour (255, 255, 255), j->font_size.points (72 * 11), - dcp::Time (rint (_subtitles[_next].from.metric().get().all_as_milliseconds() / 4)), - dcp::Time (rint (_subtitles[_next].to.metric().get().all_as_milliseconds() / 4)), + dcp::Time (rint (_subtitles[_next].from.metric().get().all_as_seconds())), + dcp::Time (rint (_subtitles[_next].to.metric().get().all_as_seconds())), i->vertical_position.line.get() * (1.5 / 22) + 0.8, dcp::TOP, j->text, @@ -96,7 +97,7 @@ SubRipDecoder::subtitles_during (ContentTimePeriod p, bool starting) const ContentTime::from_seconds (i->from.metric().get().all_as_seconds()), ContentTime::from_seconds (i->to.metric().get().all_as_seconds()) ); - + if ((starting && p.contains (t.from)) || (!starting && p.overlaps (t))) { d.push_back (t); } diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 164b2cd82..7740c6936 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -648,6 +648,8 @@ Writer::write (PlayerSubtitles subs) if (subs.text.empty ()) { return; } + + cout << "write " << subs.text.size() << " " << subs.from << " " << subs.to << "\n"; if (!_subtitle_content) { _subtitle_content.reset (new dcp::InteropSubtitleContent (_film->name(), _film->subtitle_language ())); |
