Adjust subtitle position when referenced from top.
authorCarl Hetherington <cth@carlh.net>
Fri, 20 Nov 2015 00:03:14 +0000 (00:03 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 20 Nov 2015 00:03:14 +0000 (00:03 +0000)
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.

ChangeLog
src/lib/render_subtitles.cc

index 8ed733c43e48e8782f77f1005b07596d8dc8fe32..cfa5de09376200f09c61dc2f862f96812b371fca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-19  Carl Hetherington  <cth@carlh.net>
+
+       * Adjust preview subtitle position to better match reality
+       in some cases.
+
 2015-11-19  c.hetherington  <cth@carlh.net>
 
        * Add menu option to make a DKDM for DCP-o-matic (#755).
index 9b5f585e59bf79dcc0ab86d0f06d05b7f7df88e4..26f41c89e49929a6d7fb5f933e61cf915eef2773 100644 (file)
@@ -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 */