diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-05-15 20:48:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-05-21 21:35:05 +0100 |
| commit | 1e1dc6d6d15a5c20d61fd084fa305162c93f47c9 (patch) | |
| tree | 9105b96d6d8140e024cf3035232ecee8646062a5 /src/lib | |
| parent | d5ece4a49930f905b767855e4310bae74b7fdac8 (diff) | |
Fix up ChangeLog and cherry-pick 011d403 from master: fix missing burn-in/preview with subtitles containing ampersands.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/render_subtitles.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc index 5f587c313..f4eb625cc 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_subtitles.cc @@ -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, "&", "&"); + out += t; + out += "</span>"; } |
