Fix up ChangeLog and cherry-pick 011d403 from master: fix missing burn-in/preview...
authorCarl Hetherington <cth@carlh.net>
Tue, 15 May 2018 19:48:48 +0000 (20:48 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 21 May 2018 20:35:05 +0000 (21:35 +0100)
ChangeLog
src/lib/render_subtitles.cc

index 2ac3da72e145de7eacb643b4ab0b0f8292a273e7..a69a635c4add8748b50296df06b8a228b19d6137 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,18 @@
-2018-05-18  Carl Hetherington  <cth@carlh.net>
+2018-05-15  Carl Hetherington  <cth@carlh.net>
+
+       * Fix missing burnt-in / previewed subtitles containing ampersands.
 
        * Fix slow exports from DCP content (#1285).
 
 2018-05-15  Carl Hetherington  <cth@carlh.net>
 
-       * Fix incorrect subtitle positining in a VF when there are more than
+       * Fix incorrect subtitle positioning in a VF when there are more than
        two consecutive reels with no subtitles.
 
+2018-05-15  Carl Hetherington  <cth@carlh.net>
+
+       * Version 2.12.5 released.
+
 2018-05-08  Carl Hetherington  <cth@carlh.net>
 
        * Look at subtitle colour and effect when deciding whether or not to
index 5f587c3137504c759df8ba29306e4e0b99fb0926..f4eb625cc9bf84b89e7c3fec72a39f47e0419167 100644 (file)
@@ -32,6 +32,7 @@
 #include <pango/pangocairo.h>
 #endif
 #include <boost/foreach.hpp>
+#include <boost/algorithm/string.hpp>
 #include <iostream>
 
 using std::list;
@@ -44,6 +45,7 @@ using std::cerr;
 using std::make_pair;
 using boost::shared_ptr;
 using boost::optional;
+using boost::algorithm::replace_all;
 
 static FcConfig* fc_config = 0;
 static list<pair<FontFiles, string> > fc_config_fonts;
@@ -68,7 +70,11 @@ marked_up (list<SubtitleString> subtitles, int target_height, float fade_factor)
                /* Between 1-65535 inclusive, apparently... */
                out += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65534)) + 1) + "\" ";
                out += "color=\"#" + i.colour().to_rgb_string() + "\">";
-               out += i.text ();
+
+               string t = i.text();
+               replace_all(t, "&", "&amp;");
+               out += t;
+
                out += "</span>";
        }