summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-05-10 01:16:44 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-11 20:36:10 +0200
commitb7a57184200d340bebcf81552aa1f05f220a8ec5 (patch)
tree77fa11cc1ff6fff7d71635619bbc68d8c225839a /src/lib
parentd2e40a18eee940f1333c7e63d423b1d56e50c5e6 (diff)
Fix ignore_video checker for separate-3D content (#2246).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 53b173333..f3d78ab32 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -272,17 +272,17 @@ Player::setup_pieces_unlocked ()
}
}
+ auto ignore_overlap = [](shared_ptr<VideoContent> v) {
+ return v && v->use() && v->frame_type() != VideoFrameType::THREE_D_LEFT && v->frame_type() != VideoFrameType::THREE_D_RIGHT;
+ };
+
for (auto i = _pieces.begin(); i != _pieces.end(); ++i) {
- if (auto video = (*i)->content->video) {
- if (video->use() && video->frame_type() != VideoFrameType::THREE_D_LEFT && video->frame_type() != VideoFrameType::THREE_D_RIGHT) {
- /* Look for content later in the content list with in-use video that overlaps this */
- auto period = DCPTimePeriod((*i)->content->position(), (*i)->content->end(_film));
- auto j = i;
- ++j;
- for (; j != _pieces.end(); ++j) {
- if ((*j)->content->video && (*j)->content->video->use()) {
- (*i)->ignore_video = DCPTimePeriod((*j)->content->position(), (*j)->content->end(_film)).overlap(period);
- }
+ if (ignore_overlap((*i)->content->video)) {
+ /* Look for content later in the content list with in-use video that overlaps this */
+ auto const period = DCPTimePeriod((*i)->content->position(), (*i)->content->end(_film));
+ for (auto j = std::next(i); j != _pieces.end(); ++j) {
+ if ((*j)->content->video && ignore_overlap((*j)->content->video)) {
+ (*i)->ignore_video = DCPTimePeriod((*j)->content->position(), (*j)->content->end(_film)).overlap(period);
}
}
}