Don't write multiple <LoadFont> tags to Interop subtitles (#1273).
[dcpomatic.git] / src / lib / dcp_encoder.cc
index 3a4a793a87c5fdcfa35c5a1db3b150ce88440a07..f1e819083a1728ffbf603386e52f0b5b5253dfd4 100644 (file)
@@ -94,7 +94,18 @@ DCPEncoder::go ()
        }
 
        if (_non_burnt_subtitles) {
-               _writer->write (_player->get_subtitle_fonts ());
+               list<shared_ptr<Font> > fonts = _player->get_subtitle_fonts ();
+
+               if (fonts.size() > 1 && _film->interop()) {
+                       /* Interop will ignore second and subsequent <LoadFont>s so don't even
+                          write them as they upset some validators.
+                       */
+                       shared_ptr<Font> first = fonts.front ();
+                       fonts.clear ();
+                       fonts.push_back (first);
+               }
+
+               _writer->write (fonts);
        }
 
        while (!_player->pass ()) {}