2017-07-28 Carl Hetherington <cth@carlh.net>
+ * Support a few more SSA style tags.
+
* Updated de_DE translation from Carsten Kurz.
* Version 2.11.15 released.
return (('ffmpeg-cdist', '5fce90f', ffmpeg_options),
('libdcp', '047d8ff'),
- ('libsub', 'd3cbf2f'),
+ ('libsub', 'ec880ed'),
('rtaudio-cdist', None))
def configure_options(target):
}
sub::RawSubtitle base;
- list<sub::RawSubtitle> raw = sub::SSAReader::parse_line (base, bits[9]);
+ list<sub::RawSubtitle> raw = sub::SSAReader::parse_line (
+ base,
+ bits[9],
+ _ffmpeg_content->video->size().width,
+ _ffmpeg_content->video->size().height
+ );
BOOST_FOREACH (sub::Subtitle const & i, sub::collect<list<sub::Subtitle> > (raw)) {
subtitle->emit_text_start (from, i);
void
SubtitleDecoder::emit_text_start (ContentTime from, sub::Subtitle const & subtitle)
{
- /* See if our next subtitle needs to be placed on screen by us */
+ /* See if our next subtitle needs to be vertically placed on screen by us */
bool needs_placement = false;
optional<int> bottom_line;
BOOST_FOREACH (sub::Line i, subtitle.lines) {
case sub::TOP_OF_SCREEN:
v_align = dcp::VALIGN_TOP;
break;
- case sub::CENTRE_OF_SCREEN:
+ case sub::VERTICAL_CENTRE_OF_SCREEN:
v_align = dcp::VALIGN_CENTER;
break;
case sub::BOTTOM_OF_SCREEN:
effect = dcp::SHADOW;
}
+ dcp::HAlign h_align;
+ switch (i.horizontal_position.reference) {
+ case sub::LEFT_OF_SCREEN:
+ h_align = dcp::HALIGN_LEFT;
+ break;
+ case sub::HORIZONTAL_CENTRE_OF_SCREEN:
+ h_align = dcp::HALIGN_CENTER;
+ break;
+ case sub::RIGHT_OF_SCREEN:
+ h_align = dcp::HALIGN_RIGHT;
+ break;
+ }
+
out.push_back (
dcp::SubtitleString (
string(TEXT_FONT_ID),
dcp::Time (from.seconds(), 1000),
/* XXX: hmm; this is a bit ugly (we don't know the to time yet) */
dcp::Time (),
- 0,
- dcp::HALIGN_CENTER,
+ i.horizontal_position.proportional,
+ h_align,
v_position,
v_align,
dcp::DIRECTION_LTR,