From c226f90a2c113b8bbc270f29e6aa035ae1229d57 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 18 Dec 2013 14:49:57 +0000 Subject: Repeat frames rather than using black for missing frames when we're inside some content. --- src/lib/player.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/player.cc b/src/lib/player.cc index d60dfb6a9..a79a4fc5e 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -158,8 +158,20 @@ Player::pass () if (dv) { if (!_just_did_inaccurate_seek && earliest_time > _video_position) { - /* XXX: if we're inside some content, repeat the last frame... otherwise emit black */ - emit_black (); + + /* See if we're inside some video content */ + list >::iterator i = _pieces.begin(); + while (i != _pieces.end() && ((*i)->content->position() >= _video_position || _video_position >= (*i)->content->end())) { + ++i; + } + + if (i == _pieces.end() || !_last_incoming_video.video || !_have_valid_pieces) { + /* We're outside all video content */ + emit_black (); + } else { + _last_incoming_video.video->dcp_time = _video_position; + emit_video (_last_incoming_video.weak_piece, _last_incoming_video.video); + } } else { emit_video (earliest_piece, dv); earliest_piece->decoder->get (); -- cgit v1.2.3