Make sure SMPTE subtitle MXFs get the right intrinsic duration.
authorCarl Hetherington <cth@carlh.net>
Tue, 6 Oct 2015 14:36:42 +0000 (15:36 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 6 Oct 2015 14:36:42 +0000 (15:36 +0100)
ChangeLog
src/lib/writer.cc

index 598636ff1a1e39aa29259e77dce36cf226c2b34f..e3265c5e9f7dc63c7ebe2507d8d9f17f0b3096ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-10-06  Carl Hetherington  <cth@carlh.net>
 
+       * Fix invalid SMPTE subtitle output
+       in some cases.
+
        * Speculative support for multi-part
        bitmap subtitles (#709).
 
index bace6602dfb6331fa74a643244757fc4f9caeb81..3f856737b2e00b7fbc13ce342a068e8b66bfc485 100644 (file)
@@ -617,6 +617,13 @@ Writer::finish ()
                        boost::filesystem::create_directories (directory);
                        _subtitle_asset->write (directory / ("sub_" + _subtitle_asset->id() + ".xml"));
                } else {
+                       /* All our assets should be the same length; use the picture asset length here
+                          as a reference to set the subtitle one.
+                       */
+                       dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(_subtitle_asset)->set_intrinsic_duration (
+                               reel_picture_asset->intrinsic_duration ()
+                               );
+
                        _subtitle_asset->write (
                                _film->dir (_film->dcp_name ()) / ("sub_" + _subtitle_asset->id() + ".mxf")
                                );