summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-11 15:20:33 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-11 16:05:58 +0000
commit6bd8be029c72180a41d70e590bf2cb85a77317bf (patch)
treef31286d8a6f4aa990fce2af549e5eb3cb7909b34 /src/lib/player.cc
parent5c93e50af883f02eadcf9a7bfe9cbfabbb3be844 (diff)
Add language property to SubtitleContent and use it in output DCP subtitle files.
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index fabb5b211..396dc9906 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -50,6 +50,8 @@
#include <stdint.h>
#include <algorithm>
+#include "i18n.h"
+
#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
using std::list;
@@ -549,6 +551,12 @@ 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 */