summaryrefslogtreecommitdiff
path: root/src/lib/reel_writer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-03-16 14:24:48 +0100
committerCarl Hetherington <cth@carlh.net>2021-03-16 14:37:42 +0100
commit3b78e9223c9be784531475acacb88b59b2459f48 (patch)
tree7c97e11d3e4fd364f015c186594b41d13bcca495 /src/lib/reel_writer.cc
parent7a1563c37d6e4e8ab016e8d3b2bcf5e29a327053 (diff)
Split subtitles at reel boundaries (#1918).
Diffstat (limited to 'src/lib/reel_writer.cc')
-rw-r--r--src/lib/reel_writer.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index ad52a1ca1..184707373 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -868,11 +868,12 @@ ReelWriter::write (PlayerText subs, TextType type, optional<DCPTextTrack> track,
DCPOMATIC_ASSERT (false);
}
- auto const vfr = film()->video_frame_rate();
+ /* timecode rate for subtitles we emit; we might as well stick to ms accuracy here, I think */
+ auto const tcr = 1000;
for (auto i: subs.string) {
- i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), vfr));
- i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), vfr));
+ i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), tcr));
+ i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr));
asset->add (make_shared<dcp::SubtitleString>(i));
}
@@ -880,8 +881,8 @@ ReelWriter::write (PlayerText subs, TextType type, optional<DCPTextTrack> track,
asset->add (
make_shared<dcp::SubtitleImage>(
i.image->as_png(),
- dcp::Time(period.from.seconds() - _period.from.seconds(), vfr),
- dcp::Time(period.to.seconds() - _period.from.seconds(), vfr),
+ dcp::Time(period.from.seconds() - _period.from.seconds(), tcr),
+ dcp::Time(period.to.seconds() - _period.from.seconds(), tcr),
i.rectangle.x, dcp::HAlign::LEFT, i.rectangle.y, dcp::VAlign::TOP,
dcp::Time(), dcp::Time()
)