Fix duration/intrinsic duration confusion.
authorCarl Hetherington <cth@carlh.net>
Wed, 31 Jan 2018 01:07:51 +0000 (01:07 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 31 Jan 2018 01:07:51 +0000 (01:07 +0000)
src/lib/reel_writer.cc

index 4aa5ff3a7260fd4498ff5304c3ed0dd4a6f6c056..da246ca0aeb25e41ec4ad221ec8edfbed225125b 100644 (file)
@@ -458,10 +458,12 @@ ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr
                } else {
 
                        /* All our assets should be the same length; use the picture asset length here
-                          as a reference to set the subtitle one.
+                          as a reference to set the subtitle one.  We'll use the duration rather than
+                          the intrinsic duration; we don't care if the picture asset has been trimmed, we're
+                          just interested in its presentation length.
                        */
                        dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(_subtitle_asset)->set_intrinsic_duration (
-                               reel_picture_asset->intrinsic_duration ()
+                               reel_picture_asset->duration ()
                                );
 
                        _subtitle_asset->write (
@@ -473,7 +475,7 @@ ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr
                        new dcp::ReelSubtitleAsset (
                                _subtitle_asset,
                                dcp::Fraction (_film->video_frame_rate(), 1),
-                               reel_picture_asset->intrinsic_duration (),
+                               reel_picture_asset->duration(),
                                0
                                )
                        );