Add language property to SubtitleContent and use it in output DCP subtitle files.
[dcpomatic.git] / src / lib / player.cc
index fabb5b21134b00bf2898237f867f5edbbeaa385d..396dc990684667b93060df953cb767f6e6246335 100644 (file)
@@ -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 */