summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-25 17:58:48 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-07 09:29:59 +0200
commit2c08f1353a2f789668925fa50692b19e78d9f530 (patch)
treef0ccbebcfea6894696268e384768532def7e0e26
parent36f8753fa7827deda6af29ffe828a8e6d22273c0 (diff)
Add Piece:fonts().
-rw-r--r--src/lib/piece.cc7
-rw-r--r--src/lib/piece.h2
-rw-r--r--src/lib/player.cc2
3 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/piece.cc b/src/lib/piece.cc
index 16fcb32bc..ca92f1db5 100644
--- a/src/lib/piece.cc
+++ b/src/lib/piece.cc
@@ -33,6 +33,7 @@
using std::dynamic_pointer_cast;
using std::make_shared;
using std::shared_ptr;
+using std::vector;
using boost::optional;
using namespace dcpomatic;
@@ -255,3 +256,9 @@ Piece::decoder_before(shared_ptr<const Film> film, optional<dcpomatic::DCPTime>
return {};
}
+vector<dcpomatic::FontData>
+Piece::fonts () const
+{
+ return decoder->fonts();
+}
+
diff --git a/src/lib/piece.h b/src/lib/piece.h
index 8f4b91f22..ac11de55a 100644
--- a/src/lib/piece.h
+++ b/src/lib/piece.h
@@ -26,6 +26,7 @@
#include "audio_stream.h"
#include "content_video.h"
#include "dcpomatic_time.h"
+#include "font_data.h"
#include "frame_rate_change.h"
#include "types.h"
#include <map>
@@ -72,6 +73,7 @@ public:
void seek (std::shared_ptr<const Film> film, dcpomatic::DCPTime time, bool accurate);
boost::optional<dcpomatic::DCPTime> decoder_before(std::shared_ptr<const Film> film, boost::optional<dcpomatic::DCPTime> time);
+ std::vector<dcpomatic::FontData> fonts () const;
std::shared_ptr<Decoder> decoder;
boost::optional<dcpomatic::DCPTimePeriod> ignore_video;
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 91d429708..4f81f51f3 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -425,7 +425,7 @@ Player::get_subtitle_fonts ()
/* XXX: things may go wrong if there are duplicate font IDs
with different font files.
*/
- auto f = i->decoder->fonts ();
+ auto f = i->fonts ();
copy (f.begin(), f.end(), back_inserter(fonts));
}