diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-06-23 22:50:54 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-01 16:38:52 +0100 |
| commit | 5f8bb6c42ebcc92d05c1d160ac66d00b202cd6ef (patch) | |
| tree | e2234f8eb4b003f6ba0e28bef4a4e6af8eb0c4f0 | |
| parent | 50d75c93a6430fd82e839f9d575d54e90f26dc92 (diff) | |
Add add_fonts() to Piece.
| -rw-r--r-- | src/lib/piece.h | 2 | ||||
| -rw-r--r-- | src/lib/player.cc | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/piece.h b/src/lib/piece.h index deeecfa2f..31fbfc256 100644 --- a/src/lib/piece.h +++ b/src/lib/piece.h @@ -45,6 +45,8 @@ public: dcpomatic::ContentTime dcp_to_content_time (boost::shared_ptr<const Film> film, dcpomatic::DCPTime t) const; dcpomatic::DCPTime content_time_to_dcp (dcpomatic::ContentTime t) const; + void add_fonts (std::list<boost::shared_ptr<dcpomatic::Font> >& fonts) const; + private: std::vector<boost::shared_ptr<Content> > _content; std::vector<boost::shared_ptr<Decoder> > _decoder; diff --git a/src/lib/player.cc b/src/lib/player.cc index 2aa23bc15..9445d63b8 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -394,13 +394,7 @@ Player::get_subtitle_fonts () list<shared_ptr<Font> > 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)); - } + i->add_fonts (fonts); } return fonts; |
