diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-15 19:22:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-15 19:22:43 +0100 |
| commit | 7a1563c37d6e4e8ab016e8d3b2bcf5e29a327053 (patch) | |
| tree | 61a438d0fd1838518789efe5a03096dfcca978f2 /src/lib | |
| parent | a8f48589d3eaec9de5bfd34f45410f88ab836363 (diff) | |
Use period when adding text subs, like we do with image ones.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/reel_writer.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 136d2405e..ad52a1ca1 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -868,19 +868,20 @@ ReelWriter::write (PlayerText subs, TextType type, optional<DCPTextTrack> track, DCPOMATIC_ASSERT (false); } + auto const vfr = film()->video_frame_rate(); + for (auto i: subs.string) { - /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */ - i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr)); - i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr)); - asset->add (shared_ptr<dcp::Subtitle>(new dcp::SubtitleString(i))); + i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), vfr)); + i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), vfr)); + asset->add (make_shared<dcp::SubtitleString>(i)); } for (auto i: subs.bitmap) { asset->add ( make_shared<dcp::SubtitleImage>( i.image->as_png(), - dcp::Time(period.from.seconds() - _period.from.seconds(), film()->video_frame_rate()), - dcp::Time(period.to.seconds() - _period.from.seconds(), film()->video_frame_rate()), + dcp::Time(period.from.seconds() - _period.from.seconds(), vfr), + dcp::Time(period.to.seconds() - _period.from.seconds(), vfr), i.rectangle.x, dcp::HAlign::LEFT, i.rectangle.y, dcp::VAlign::TOP, dcp::Time(), dcp::Time() ) |
