diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-17 22:47:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-17 22:47:04 +0100 |
| commit | d892e433ac6c14890b7f87052eda38556abb6b62 (patch) | |
| tree | aeec4c17432d4cbf942158b2e609a83f1e4bc93c /src/lib | |
| parent | ba150e9d1e5a195b25976ac2eba254e9ba43da9b (diff) | |
Respect _no_video and _no_audio when filling.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index ddf585ef1..bd33963a0 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -553,10 +553,12 @@ Player::pass () /* 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) */ - /* XXX: this should take _no_video into account */ if (video_fill_from && (!earliest || *video_fill_from < earliest_content) && ((fill_towards - *video_fill_from)) >= one_video_frame()) { - emit_video (black_player_video_frame(), *video_fill_from); - filled = true; + list<DCPTimePeriod> p = subtract(DCPTimePeriod(*video_fill_from, *video_fill_from + one_video_frame()), _no_video); + if (!p.empty ()) { + emit_video (black_player_video_frame(), p.front().from); + filled = true; + } } else if (_playlist->length() == DCPTime()) { /* Special case of an empty Film; just give one black frame */ emit_video (black_player_video_frame(), DCPTime()); @@ -575,7 +577,10 @@ Player::pass () if (period.duration() > one_video_frame()) { period.to = period.from + one_video_frame(); } - fill_audio (period); + list<DCPTimePeriod> p = subtract(period, _no_video); + if (!p.empty ()) { + fill_audio (period); + } filled = true; } |
