diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-18 14:49:57 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-18 14:49:57 +0000 |
| commit | c226f90a2c113b8bbc270f29e6aa035ae1229d57 (patch) | |
| tree | 34609bf4e6f220185de5ec3e1ce381f8e41016bb /src/lib | |
| parent | 060a980527bc0b39e12494fec3c0baaab4c9d086 (diff) | |
Repeat frames rather than using black for missing frames when we're inside some content.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 16 |
1 files changed, 14 insertions, 2 deletions
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<shared_ptr<Piece> >::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 (); |
