summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-05-17 23:34:04 +0100
committerCarl Hetherington <cth@carlh.net>2017-05-17 23:34:04 +0100
commit4f806ddec2b60c2d2e7a7d756e8aa299305b1e9f (patch)
tree92f851443420ef8d97f08990ae2f852f5cff0057
parentf33ce8ef9af44e6fbef9cb89f11970d5ec2a1ff5 (diff)
parentd892e433ac6c14890b7f87052eda38556abb6b62 (diff)
Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
-rw-r--r--src/lib/player.cc13
-rw-r--r--test/vf_test.cc3
2 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 6b428bbac..00abc7190 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;
}
diff --git a/test/vf_test.cc b/test/vf_test.cc
index ac8256be3..4abd12635 100644
--- a/test/vf_test.cc
+++ b/test/vf_test.cc
@@ -112,8 +112,9 @@ BOOST_AUTO_TEST_CASE (vf_test2)
dcp->set_reference_audio (true);
shared_ptr<Content> sub = content_factory(vf, "test/data/subrip4.srt").front();
vf->examine_and_add_content (sub);
+ DCPOMATIC_ASSERT (!wait_for_jobs ());
vf->make_dcp ();
- wait_for_jobs ();
+ DCPOMATIC_ASSERT (!wait_for_jobs ());
vf->write_metadata ();
dcp::DCP ov_c (ov->dir (ov->dcp_name ()));