Change how video timing is done.
[dcpomatic.git] / src / lib / dcp_decoder.cc
index ad7d3e11277910fb62eb27611f0472a6ed97a94c..3ccb6ccc671ff3ad2335cc31b14f739a375f89bc 100644 (file)
@@ -177,7 +177,7 @@ DCPDecoder::pass ()
                                        AV_PIX_FMT_XYZ12LE,
                                        _forced_reduction
                                        ),
-                               _offset + frame
+                               ContentTime::from_frames(_offset + frame, vfr)
                                );
                } else {
                        video->emit (
@@ -189,7 +189,7 @@ DCPDecoder::pass ()
                                        AV_PIX_FMT_XYZ12LE,
                                        _forced_reduction
                                        ),
-                               _offset + frame
+                               ContentTime::from_frames(_offset + frame, vfr)
                                );
 
                        video->emit (
@@ -201,7 +201,7 @@ DCPDecoder::pass ()
                                        AV_PIX_FMT_XYZ12LE,
                                        _forced_reduction
                                        ),
-                               _offset + frame
+                               ContentTime::from_frames(_offset + frame, vfr)
                                );
                }
        }
@@ -303,12 +303,15 @@ DCPDecoder::pass_texts (
                                                        ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.in().as_seconds()),
                                                        ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
                                                        ),
-                                               strings
+                                               strings,
+                                               _dcp_content->standard()
                                                );
                                        strings.clear ();
                                }
 
-                               strings.push_back (*is);
+                               dcp::SubtitleString is_copy = *is;
+                               is_copy.set_font(id_for_font_in_reel(is_copy.font().get_value_or(""), _reel - _reels.begin()));
+                               strings.push_back(is_copy);
                        }
 
                        /* XXX: perhaps these image subs should also be collected together like the string ones are;
@@ -336,7 +339,8 @@ DCPDecoder::pass_texts (
                                        ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.in().as_seconds()),
                                        ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
                                        ),
-                               strings
+                               strings,
+                               _dcp_content->standard()
                                );
                        strings.clear ();
                }