From 67775a6d0d28131b98ae284c7be23d79ccdab685 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 14 Apr 2020 23:11:08 +0200 Subject: 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. --- src/lib/empty.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib/empty.cc') 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 film, list > pieces, function)> part) +Empty::Empty (shared_ptr film, shared_ptr playlist, function)> part) { list full; - BOOST_FOREACH (shared_ptr i, pieces) { + BOOST_FOREACH (shared_ptr 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; -- cgit v1.2.3