From 9e025d3f85f9d6d855b3d5e6c90bca0eac3a3d49 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 16 Oct 2015 14:38:44 +0100 Subject: Avoid decoding other packets when looking for subs. The "accumulation" of, for example, video data when we are looking for audio data is an *optimisation* to reduce the number of seeks. It should not be necessary for correctness (the output should be right even if we never kept anything except what we were looking for). Doing this accumulation is not always an optimisation; sometimes not doing it is better. Avoiding it when going back for subtitles is one of these cases. --- src/lib/dcp_decoder.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/dcp_decoder.cc') diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 21eb2f7ea..ada0d01d1 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -59,7 +59,7 @@ DCPDecoder::DCPDecoder (shared_ptr c, bool fast) } bool -DCPDecoder::pass () +DCPDecoder::pass (PassReason reason) { if (_reel == _reels.end () || !_dcp_content->can_be_played ()) { return true; @@ -68,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); @@ -88,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 (); -- cgit v1.2.3