summaryrefslogtreecommitdiff
path: root/src/lib/subtitle_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-10 10:20:37 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-10 10:20:37 +0100
commit71f9ae33ffbbc1b99594ac5d9a6d6cd6721061f4 (patch)
treeffde2acd865ca38fc4a2c0be424f7f5a2ea2d96c /src/lib/subtitle_decoder.cc
parent4f7b82033026156981a51e7cf8ddc062f504210d (diff)
Specify a default font size if none comes from libsub.
Use the specified time period rather than looking in the Subtitle.
Diffstat (limited to 'src/lib/subtitle_decoder.cc')
-rw-r--r--src/lib/subtitle_decoder.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc
index f129805d3..b7d03b591 100644
--- a/src/lib/subtitle_decoder.cc
+++ b/src/lib/subtitle_decoder.cc
@@ -180,6 +180,11 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt
}
}
+ if (!j.font_size.specified()) {
+ /* Fallback default font size if none other has been specified */
+ j.font_size.set_points (72);
+ }
+
out.push_back (
dcp::SubtitleString (
string(TEXT_FONT_ID),
@@ -189,8 +194,8 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt
content()->colour(),
j.font_size.points (72 * 11),
1.0,
- dcp::Time (subtitle.from.all_as_seconds(), 1000),
- dcp::Time (subtitle.to.all_as_seconds(), 1000),
+ dcp::Time (period.from.seconds(), 1000),
+ dcp::Time (period.to.seconds(), 1000),
0,
dcp::HALIGN_CENTER,
v_position,