summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-20 22:29:21 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-20 22:29:21 +0000
commit5f2a57d1c21c3e8067dfd1f68505b1bf96e1d7c7 (patch)
tree01e112c11223eb94772e86ca40fbefdb7ec05b8e /src/lib/player.cc
parentb607482671ee26a3462d9fcefdd7d7ddcd25184c (diff)
Basic pass-through of font information when using DCP subtitles.
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 396dc9906..695ce00ce 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -551,12 +551,6 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting)
continue;
}
- /* XXX: this will break down if we have multiple subtitle content */
- ps.language = subtitle_content->subtitle_language();
- if (ps.language.empty ()) {
- ps.language = _("Unknown");
- }
-
shared_ptr<SubtitleDecoder> subtitle_decoder = dynamic_pointer_cast<SubtitleDecoder> ((*j)->decoder);
ContentTime const from = dcp_to_content_subtitle (*j, time);
/* XXX: this video_frame_rate() should be the rate that the subtitle content has been prepared for */
@@ -592,3 +586,25 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting)
return ps;
}
+
+list<shared_ptr<Font> >
+Player::get_subtitle_fonts ()
+{
+ if (!_have_valid_pieces) {
+ setup_pieces ();
+ }
+
+ list<shared_ptr<Font> > fonts;
+ BOOST_FOREACH (shared_ptr<Piece>& p, _pieces) {
+ shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (p->content);
+ if (sc) {
+ /* XXX: things may go wrong if there are duplicate font IDs
+ with different font files.
+ */
+ list<shared_ptr<Font> > f = sc->fonts ();
+ copy (f.begin(), f.end(), back_inserter (fonts));
+ }
+ }
+
+ return fonts;
+}