summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-20 00:03:14 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-20 00:03:14 +0000
commite9edb9ffd2deee65b2ab044a4a8bc149ed44a0b4 (patch)
tree5ecac773973029ed4b1252171f5dc64698a98b8b /src
parent8f7efc8c704891a9c5499c17fa89fe84cdf5bde4 (diff)
Adjust subtitle position when referenced from top.
SMPTE says "top" means that vposition is from the top of the screen to the top of the subtitle, but Dolby servers apparently make it top of screen to bottom of subtitle; adjust the preview to do the latter.
Diffstat (limited to 'src')
-rw-r--r--src/lib/render_subtitles.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc
index 9b5f585e5..26f41c89e 100644
--- a/src/lib/render_subtitles.cc
+++ b/src/lib/render_subtitles.cc
@@ -261,8 +261,13 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts,
int y = 0;
switch (subtitles.front().v_align ()) {
case dcp::VALIGN_TOP:
- /* v_position is distance between top of frame and top of subtitle */
- y = subtitles.front().v_position() * target.height;
+ /* SMPTE says that v_position is the distance between top
+ of frame and top of subtitle, but this doesn't always seem to be
+ the case in practice; Gunnar Ásgeirsson's Dolby server appears
+ to put VALIGN_TOP subs with v_position as the distance between top
+ of frame and bottom of subtitle.
+ */
+ y = subtitles.front().v_position() * target.height - layout_height / PANGO_SCALE;
break;
case dcp::VALIGN_CENTER:
/* v_position is distance between centre of frame and centre of subtitle */