Fix call to dcp::Time constructor.
authorCarl Hetherington <cth@carlh.net>
Sun, 11 Jan 2015 16:46:12 +0000 (16:46 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 11 Jan 2015 16:46:12 +0000 (16:46 +0000)
src/lib/subrip_decoder.cc
src/lib/writer.cc

index 0ef747cf17a44c94d3ddff92e1017af66c0b2612..22f7b6ba4b27ac23fc1b94a4b53214b9e82bd8a8 100644 (file)
@@ -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);
                }
index 164b2cd82fa744b33818729ed58d06de113fbd5b..7740c69365c5485547238606126b1cb4578bef31 100644 (file)
@@ -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 ()));