More fixes for newer libdcp.
authorCarl Hetherington <cth@carlh.net>
Mon, 15 Dec 2014 14:22:40 +0000 (14:22 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 15 Dec 2014 14:22:40 +0000 (14:22 +0000)
src/lib/render_subtitles.cc
src/lib/subrip_decoder.cc
src/lib/writer.cc

index 6f103246c9c6f3538de616f153062308fe6b0de9..b2900d27a8dfdc3e99f0f5fd289b45beb3b56c8e 100644 (file)
@@ -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);
index 411e7542d26be7bddfd036f5a42c8144cef07e17..e13b1106356cf8ea1228c4e8ea562050d59979d2 100644 (file)
@@ -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 */
index eca0b134a72382303b81cb93e673f8303cf40d02..5a6998c8af67c70f3ab25c40eb9c8977d86b7702 100644 (file)
@@ -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) {