pot/merge.
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 08c2bf7ec3642a86f687d9d4d24e6f7cbeaa663c..617f7ec536530b71e83558f0f871b216cfe84312 100644 (file)
@@ -23,6 +23,7 @@
 #include "dcp_subtitle_decoder.h"
 #include "font.h"
 #include "text_content.h"
+#include "util.h"
 #include <dcp/interop_subtitle_asset.h>
 #include <dcp/load_font_node.h>
 
@@ -46,6 +47,12 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<
        _subtitles = asset->subtitles ();
        _next = _subtitles.begin ();
 
+       if (dynamic_pointer_cast<dcp::InteropSubtitleAsset>(asset)) {
+               _standard = dcp::Standard::INTEROP;
+       } else {
+               _standard = dcp::Standard::SMPTE;
+       }
+
        text.push_back (make_shared<TextDecoder>(this, content->only_text()));
        update_position();
 }
@@ -102,7 +109,7 @@ DCPSubtitleDecoder::pass ()
                }
        }
 
-       only_text()->emit_plain (p, s);
+       only_text()->emit_plain(p, s, _standard);
 
        update_position();