diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-12-15 14:22:40 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-12-15 14:22:40 +0000 |
| commit | 48fc425ae9c6a92ce42b26dd441b6723c9912c5d (patch) | |
| tree | 33596592a7ddea3e75f7a99d96544050abdc7393 /src/lib | |
| parent | 784b55d18f4bddddd49fdb62475638336dcdcb21 (diff) | |
More fixes for newer libdcp.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/render_subtitles.cc | 6 | ||||
| -rw-r--r-- | src/lib/subrip_decoder.cc | 4 | ||||
| -rw-r--r-- | src/lib/writer.cc | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc index 6f103246c..b2900d27a 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_subtitles.cc @@ -88,11 +88,7 @@ render_subtitles (list<dcp::SubtitleString> subtitles, dcp::Size target) context->set_line_width (1); for (list<dcp::SubtitleString>::const_iterator i = subtitles.begin(); i != subtitles.end(); ++i) { - string f = i->font (); - if (f.empty ()) { - f = "Arial"; - } - Pango::FontDescription font (f); + Pango::FontDescription font (i->font().get_value_or ("Arial")); font.set_absolute_size (i->size_in_pixels (target.height) * PANGO_SCALE); if (i->italic ()) { font.set_style (Pango::STYLE_ITALIC); diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc index 411e7542d..e13b11063 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/subrip_decoder.cc @@ -23,7 +23,9 @@ using std::list; using std::vector; +using std::string; using boost::shared_ptr; +using boost::optional; SubRipDecoder::SubRipDecoder (shared_ptr<const SubRipContent> content) : SubtitleDecoder (content) @@ -58,7 +60,7 @@ SubRipDecoder::pass () for (list<sub::Block>::const_iterator j = i->blocks.begin(); j != i->blocks.end(); ++j) { out.push_back ( dcp::SubtitleString ( - "Arial", + optional<string> (), j->italic, dcp::Color (255, 255, 255), /* .srt files don't specify size, so this is an arbitrary value */ diff --git a/src/lib/writer.cc b/src/lib/writer.cc index eca0b134a..5a6998c8a 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -44,6 +44,7 @@ #include <dcp/dcp.h> #include <dcp/cpl.h> #include <dcp/signer.h> +#include <dcp/interop_subtitle_content.h> #include <fstream> #include <cerrno> @@ -615,7 +616,7 @@ Writer::write (PlayerSubtitles subs) } if (!_subtitle_content) { - _subtitle_content.reset (new dcp::SubtitleContent (_film->name(), subs.language)); + _subtitle_content.reset (new dcp::InteropSubtitleContent (_film->name(), subs.language)); } for (list<dcp::SubtitleString>::const_iterator i = subs.text.begin(); i != subs.text.end(); ++i) { |
