diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-14 23:11:08 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-14 23:11:08 +0200 |
| commit | 67775a6d0d28131b98ae284c7be23d79ccdab685 (patch) | |
| tree | 6ba20512690d66685600a0fd7d6850ad03ba784b /src/lib/empty.cc | |
| parent | 4ab86ef0295bcd6bb9297996a06006f371d22bae (diff) | |
Fix Empty/Player behaviour when using a playlist that is not the same as the Film's.
Previously Empty would use the length of the film for its end point.
Now it takes a Playlist (rather than a list of Pieces) and uses the length
of that playlist for its end point.
This fixes #1543, in which single-content audio analysis jobs would run for the whole
length of the film, rather than the length of the content, producing
strange graphs and incorrect progress reports.
Diffstat (limited to 'src/lib/empty.cc')
| -rw-r--r-- | src/lib/empty.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/empty.cc b/src/lib/empty.cc index 206acfdb0..71bf3aa95 100644 --- a/src/lib/empty.cc +++ b/src/lib/empty.cc @@ -36,16 +36,16 @@ using boost::dynamic_pointer_cast; using boost::function; using namespace dcpomatic; -Empty::Empty (shared_ptr<const Film> film, list<shared_ptr<Piece> > pieces, function<bool (shared_ptr<Piece>)> part) +Empty::Empty (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, function<bool (shared_ptr<const Content>)> part) { list<DCPTimePeriod> full; - BOOST_FOREACH (shared_ptr<Piece> i, pieces) { + BOOST_FOREACH (shared_ptr<Content> i, playlist->content()) { if (part(i)) { - full.push_back (DCPTimePeriod (i->content->position(), i->content->end(film))); + full.push_back (DCPTimePeriod (i->position(), i->end(film))); } } - _periods = subtract (DCPTimePeriod(DCPTime(), film->length()), coalesce(full)); + _periods = subtract (DCPTimePeriod(DCPTime(), playlist->length(film)), coalesce(full)); if (!_periods.empty ()) { _position = _periods.front().from; |
