diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-20 23:41:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-22 02:37:53 +0100 |
| commit | ddcd4f3ba0af3e9d49dbb68127317cd0d871a248 (patch) | |
| tree | 1091683b8dcaf82cd517b844be1d76f290f88f50 /src/lib/player.cc | |
| parent | bf4446523dd891049cabf1bcd68d20def57bc731 (diff) | |
Pass fonts from content around as FontData.
i.e. as a block of memory rather than a file. Also, get the
fonts from the decoder rather than the content.
Together, these changes allow us to use fonts from SMPTE DCPs
added as content. Before, fonts would be messed up in those
cases (#1885).
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 7899f2e83..dd11694ef 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -448,20 +448,18 @@ Player::content_time_to_dcp (shared_ptr<const Piece> piece, ContentTime t) const return max (DCPTime (), DCPTime (t - piece->content->trim_start(), piece->frc) + piece->content->position()); } -list<shared_ptr<Font> > +vector<FontData> Player::get_subtitle_fonts () { boost::mutex::scoped_lock lm (_mutex); - list<shared_ptr<Font> > fonts; + vector<FontData> fonts; BOOST_FOREACH (shared_ptr<Piece> i, _pieces) { - BOOST_FOREACH (shared_ptr<TextContent> j, i->content->text) { - /* XXX: things may go wrong if there are duplicate font IDs - with different font files. - */ - list<shared_ptr<Font> > f = j->fonts (); - copy (f.begin(), f.end(), back_inserter (fonts)); - } + /* XXX: things may go wrong if there are duplicate font IDs + with different font files. + */ + vector<FontData> f = i->decoder->fonts (); + copy (f.begin(), f.end(), back_inserter(fonts)); } return fonts; |
