Move ScopeGuard into libdcp.
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 617f7ec536530b71e83558f0f871b216cfe84312..b3e6d75531bcbf4fd86ffd0d812aae9558048f19 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "dcp_subtitle_content.h"
 #include "dcp_subtitle_decoder.h"
+#include "film.h"
 #include "font.h"
 #include "text_content.h"
 #include "util.h"
@@ -47,11 +48,7 @@ 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;
-       }
+       _subtitle_standard = asset->subtitle_standard();
 
        text.push_back (make_shared<TextDecoder>(this, content->only_text()));
        update_position();
@@ -109,7 +106,7 @@ DCPSubtitleDecoder::pass ()
                }
        }
 
-       only_text()->emit_plain(p, s, _standard);
+       only_text()->emit_plain(p, s, _subtitle_standard);
 
        update_position();