diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-06-18 01:18:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-06-18 01:18:11 +0100 |
| commit | ceeabf70e74523becf91d66a4635272c7fa694a9 (patch) | |
| tree | aebea5afe6b1b1bfd403facbdb2fb3b3f226b3ed | |
| parent | f3d195de9fbd795f44a82c274c01891eec77a1d4 (diff) | |
Small optimisation.
| -rw-r--r-- | src/lib/player.cc | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 82159df71..25e55e610 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -531,19 +531,12 @@ Player::pass () */ DCPTime fill_towards = earliest ? earliest_content : _playlist->length().ceil(_film->video_frame_rate()); - /* Work out where to fill video from */ - optional<DCPTime> video_fill_from; - if (_last_video_time) { - /* Fill from the last video or seek time */ - video_fill_from = _last_video_time; - } - bool filled = false; /* Fill some black if we would emit before the earliest piece of content. This is so we act like a phantom Piece which emits black in spaces (we only emit if we are the earliest thing) */ - if (video_fill_from && (!earliest || *video_fill_from < earliest_content) && ((fill_towards - *video_fill_from)) >= one_video_frame()) { - list<DCPTimePeriod> p = subtract(DCPTimePeriod(*video_fill_from, *video_fill_from + one_video_frame()), _no_video); + if (_last_video_time && (!earliest || *_last_video_time < earliest_content) && ((fill_towards - *_last_video_time)) >= one_video_frame()) { + list<DCPTimePeriod> p = subtract(DCPTimePeriod(*_last_video_time, *_last_video_time + one_video_frame()), _no_video); if (!p.empty ()) { emit_video (black_player_video_frame(), p.front().from); filled = true; |
