Fix incorrect timing of PNG subtitles in second and subsequent reels.
[dcpomatic.git] / src / lib / reel_writer.cc
index 3b9e413a23f47c1b00c3f92b2fffbf9ec769d38d..b7ccc07ce61fb6d05c9279fbca2e13db903420f2 100644 (file)
@@ -619,8 +619,8 @@ ReelWriter::write (PlayerText subs, TextType type, optional<DCPTextTrack> track,
                        shared_ptr<dcp::Subtitle>(
                                new dcp::SubtitleImage(
                                        i.image->as_png(),
-                                       dcp::Time(period.from.seconds(), _film->video_frame_rate()),
-                                       dcp::Time(period.to.seconds(), _film->video_frame_rate()),
+                                       dcp::Time(period.from.seconds() - _period.from.seconds(), _film->video_frame_rate()),
+                                       dcp::Time(period.to.seconds() - _period.from.seconds(), _film->video_frame_rate()),
                                        i.rectangle.x, dcp::HALIGN_LEFT, i.rectangle.y, dcp::VALIGN_TOP,
                                        dcp::Time(), dcp::Time()
                                        )