Emit subtitles with correct times when they occur at different times within a frame...
authorCarl Hetherington <cth@carlh.net>
Sun, 14 Jan 2018 00:24:28 +0000 (00:24 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 14 Jan 2018 00:24:46 +0000 (00:24 +0000)
src/lib/dcp_decoder.cc

index 1a4896f..23b8347 100644 (file)
@@ -188,12 +188,11 @@ DCPDecoder::pass_subtitles (ContentTime next)
                        true
                        );
 
-               if (!subs.empty ()) {
-                       /* XXX: assuming that all `subs' are at the same time; maybe this is ok */
+               BOOST_FOREACH (dcp::SubtitleString i, subs) {
                        subtitle->emit_text (
                                ContentTimePeriod (
-                                       ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (subs.front().in().as_seconds ()),
-                                       ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (subs.front().out().as_seconds ())
+                                       ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i.in().as_seconds ()),
+                                       ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i.out().as_seconds ())
                                        ),
                                subs
                                );