From 99cebd529d5126fc5dfb7e8ff4b5050a8e18a6f3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 12 Jul 2017 23:21:25 +0100 Subject: Don't emit black to fill up to a frame that we're not going to emit. --- src/lib/player.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/lib') diff --git a/src/lib/player.cc b/src/lib/player.cc index 3ed0e4f45..5e888f110 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -620,6 +620,14 @@ Player::video (weak_ptr wp, ContentVideo video) DCPTime const time = content_video_to_dcp (piece, video.frame); DCPTimePeriod const period (time, time + one_video_frame()); + /* Discard if it's outside the content's period or if it's before the last accurate seek */ + if ( + time < piece->content->position() || + time >= piece->content->end() || + (_last_video_time && time < *_last_video_time)) { + return; + } + /* Fill gaps that we discover now that we have some video which needs to be emitted */ if (_last_video_time) { @@ -635,14 +643,6 @@ Player::video (weak_ptr wp, ContentVideo video) } } - /* Discard if it's outside the content's period or if it's before the last accurate seek */ - if ( - time < piece->content->position() || - time >= piece->content->end() || - (_last_video_time && time < *_last_video_time)) { - return; - } - _last_video[wp].reset ( new PlayerVideo ( video.image, -- cgit v1.2.3