diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-06-23 23:01:10 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-01 16:38:52 +0100 |
| commit | 6097970d8015995ef36bfdde479515ff3bc83930 (patch) | |
| tree | 1ecb3e39d7e43445148bdbf5ce9da68b31c4a2b9 /src/lib/player.cc | |
| parent | 5f8bb6c42ebcc92d05c1d160ac66d00b202cd6ef (diff) | |
Move some stuff for position checking.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 9445d63b8..a0bd257be 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -557,21 +557,14 @@ Player::pass () optional<DCPTime> earliest_time; BOOST_FOREACH (shared_ptr<Piece> i, _pieces) { - if (i->done) { - continue; - } - - DCPTime const t = content_time_to_dcp (i, max(i->decoder->position(), i->content->trim_start())); - if (t > i->end(_film)) { - i->done = true; - } else { - - /* Given two choices at the same time, pick the one with texts so we see it before - the video. - */ - if (!earliest_time || t < *earliest_time || (t == *earliest_time && !i->decoder->text.empty())) { - earliest_time = t; + optional<DCPTime> t = i->position (); + /* Given two choices at the same time, pick the one with texts so we see it before + the video. + */ + if (t) { + if (!earliest_time || *t < *earliest_time || (*t == *earliest_time && i->has_text())) { earliest_content = i; + earliest_time = *t; } } } |
