using std::max;
using std::shared_ptr;
using boost::optional;
-using std::function;
using namespace dcpomatic;
* of the video frame)
*/
void
-TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<Image> image, dcpomatic::Rect<double> rect)
+TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<const Image> image, dcpomatic::Rect<double> rect)
{
BitmapStart (ContentBitmapText (from, image, rect));
_position = from;
TextDecoder::emit_plain_start (ContentTime from, list<dcp::SubtitleString> s)
{
for (auto& i: s) {
- /* We must escape < and > in strings, otherwise they might confuse our subtitle
- renderer (which uses some HTML-esque markup to do bold/italic etc.)
+ /* We must escape some things, otherwise they might confuse our subtitle
+ renderer (which uses entities and some HTML-esque markup to do bold/italic etc.)
*/
string t = i.text ();
+ boost::algorithm::replace_all (t, "&", "&");
boost::algorithm::replace_all (t, "<", "<");
boost::algorithm::replace_all (t, ">", ">");
i.set_text (t);
use libsub for DCP subs) we can cheat by just putting 0 in here.
*/
dcp::Time (),
- dcp::Time ()
+ dcp::Time (),
+ 0
)
);
}
* of the video frame)
*/
void
-TextDecoder::emit_bitmap (ContentTimePeriod period, shared_ptr<Image> image, dcpomatic::Rect<double> rect)
+TextDecoder::emit_bitmap (ContentTimePeriod period, shared_ptr<const Image> image, dcpomatic::Rect<double> rect)
{
emit_bitmap_start (period.from, image, rect);
emit_stop (period.to);