summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-04 00:39:39 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-04 00:39:39 +0100
commit1938b1b08d38fc199717d1875a61ef05e5b965de (patch)
tree3734257f39ea97983c7dc49425ae6d51a596215c /src/lib/player.cc
parenta45dd41c4dc7b95b1e3e79640e965ae663e7e680 (diff)
Build Empty objects from the presence or absence of decoders in
Pieces, rather than the presence or absence of content. This seems better because of cases like encrypted DCPs without a a KDM: here we may have content but no decoder.
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 15f274e98..a7440cb4f 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -123,6 +123,18 @@ Player::setup_pieces ()
setup_pieces_unlocked ();
}
+bool
+have_video (shared_ptr<Piece> piece)
+{
+ return piece->decoder && piece->decoder->video;
+}
+
+bool
+have_audio (shared_ptr<Piece> piece)
+{
+ return piece->decoder && piece->decoder->audio;
+}
+
void
Player::setup_pieces_unlocked ()
{
@@ -215,8 +227,8 @@ Player::setup_pieces_unlocked ()
}
}
- _black = Empty (_film->content(), _film->length(), bind(&Content::video, _1));
- _silent = Empty (_film->content(), _film->length(), bind(&Content::audio, _1));
+ _black = Empty (_pieces, _film->length(), bind(&have_video, _1));
+ _silent = Empty (_pieces, _film->length(), bind(&have_audio, _1));
_last_video_time = DCPTime ();
_last_video_eyes = EYES_BOTH;
@@ -238,6 +250,7 @@ Player::playlist_content_change (ChangeType type, int property, bool frequent)
/* A change in our content has gone through. Re-build our pieces. */
setup_pieces ();
} else if (type == CHANGE_TYPE_CANCELLED) {
+ boost::mutex::scoped_lock lm (_mutex);
_suspended = false;
}