diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-08 11:27:14 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-08 11:27:14 +0100 |
| commit | d02e03907214808ce9da9eb9a2267ff577e85559 (patch) | |
| tree | d7120d96de3e00cfc7c77bede4c2212c7059ec64 /src | |
| parent | 3bcfb29555c8af6b1227b9048c8c851fb4b16850 (diff) | |
Player is not finished if it's still filling in blank space.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/player.cc | 12 | ||||
| -rw-r--r-- | src/lib/player.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 081174acc..392804ee8 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -537,13 +537,14 @@ Player::pass () } } + bool filled = false; if (_last_video_time) { - fill_video (DCPTimePeriod (_last_video_time.get(), earliest ? earliest_content : _playlist->length())); + filled = fill_video (DCPTimePeriod (_last_video_time.get(), earliest ? earliest_content : _playlist->length())); } else if (_last_seek_time) { - fill_video (DCPTimePeriod (_last_seek_time.get(), _last_seek_time.get() + one_video_frame ())); + filled = fill_video (DCPTimePeriod (_last_seek_time.get(), _last_seek_time.get() + one_video_frame ())); } - if (!earliest) { + if (!earliest && !filled) { return true; } @@ -934,10 +935,11 @@ Player::resampler (shared_ptr<const AudioContent> content, AudioStreamPtr stream return r; } -void +bool Player::fill_video (DCPTimePeriod period) { /* XXX: this may not work for 3D */ + bool filled = false; BOOST_FOREACH (DCPTimePeriod i, subtract(period, _no_video)) { for (DCPTime j = i.from; j < i.to; j += one_video_frame()) { if (_playlist->video_content_at(j) && _last_video) { @@ -945,8 +947,10 @@ Player::fill_video (DCPTimePeriod period) } else { emit_video (black_player_video_frame(), j); } + filled = true; } } + return filled; } void diff --git a/src/lib/player.h b/src/lib/player.h index ea792d4da..7cffa1f11 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -110,7 +110,7 @@ private: void subtitle_stop (boost::weak_ptr<Piece>, ContentTime); boost::shared_ptr<Resampler> resampler (boost::shared_ptr<const AudioContent> content, AudioStreamPtr stream, bool create); DCPTime one_video_frame () const; - void fill_video (DCPTimePeriod period); + bool fill_video (DCPTimePeriod period); void fill_audio (DCPTimePeriod period); void audio_flush (boost::shared_ptr<Piece>, AudioStreamPtr stream); void audio_transform (boost::shared_ptr<AudioContent> content, AudioStreamPtr stream, ContentAudio content_audio, DCPTime time); |
