X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=04fffb9816f9642eb22a2bea1e09fb2adfbdfbb1;hb=2e62b2c0de47fc8e5bcb5466b2876f9b23d2ae84;hp=2bdf6a8e98547840c268a6ff748fdb81ae3e24c8;hpb=f26af8112b03b5233eb5239defd11a7428b705ad;p=dcpomatic.git diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 2bdf6a8e9..04fffb981 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -35,6 +35,7 @@ #include #include #include +#include using std::list; using std::cout; @@ -58,7 +59,7 @@ DCPDecoder::DCPDecoder (shared_ptr c, bool fast) } bool -DCPDecoder::pass () +DCPDecoder::pass (PassReason reason, bool) { if (_reel == _reels.end () || !_dcp_content->can_be_played ()) { return true; @@ -67,7 +68,7 @@ DCPDecoder::pass () double const vfr = _dcp_content->video_frame_rate (); int64_t const frame = _next.frames_round (vfr); - if ((*_reel)->main_picture ()) { + if ((*_reel)->main_picture () && reason != PASS_REASON_SUBTITLE) { shared_ptr asset = (*_reel)->main_picture()->asset (); shared_ptr mono = dynamic_pointer_cast (asset); shared_ptr stereo = dynamic_pointer_cast (asset); @@ -87,7 +88,7 @@ DCPDecoder::pass () } } - if ((*_reel)->main_sound ()) { + if ((*_reel)->main_sound () && reason != PASS_REASON_SUBTITLE) { int64_t const entry_point = (*_reel)->main_sound()->entry_point (); shared_ptr sf = (*_reel)->main_sound()->asset()->get_frame (entry_point + frame); uint8_t const * from = sf->data (); @@ -175,8 +176,8 @@ DCPDecoder::text_subtitles_during (ContentTimePeriod period, bool starting) cons int64_t const entry_point = r->main_subtitle()->entry_point (); list subs = r->main_subtitle()->subtitle_asset()->subtitles_during ( - dcp::Time (period.from.seconds ()) - dcp::Time (entry_point, vfr, vfr), - dcp::Time (period.to.seconds ()) - dcp::Time (entry_point, vfr, vfr), + dcp::Time (period.from.seconds(), 1000) - dcp::Time (entry_point, vfr, vfr), + dcp::Time (period.to.seconds(), 1000) - dcp::Time (entry_point, vfr, vfr), starting );