void
Piece::update_pull_to (DCPTime& pull_to) const
{
- if (_done) {
+ if (done()) {
return;
}
Piece::pass ()
{
LOG_DEBUG_PLAYER ("Calling pass() on %1", _content->path(0));
- _done = _decoder->pass();
+ _decoder->pass();
}
been trimmed to a point between keyframes, or something).
*/
_decoder->seek (dcp_to_content_time(position()), true);
- _done = false;
} else if (position() <= time && time < end()) {
/* During; seek to position */
_decoder->seek (dcp_to_content_time(time), accurate);
- _done = false;
- } else {
- /* After; this piece is done */
- _done = true;
}
}
optional<dcpomatic::DCPTime>
Piece::decoder_before(optional<dcpomatic::DCPTime> time)
{
- if (_done) {
- return {};
- }
-
auto t = content_time_to_dcp(_content, std::max(_decoder->position(), _content->trim_start()));
DCPOMATIC_ASSERT (t);
- if (*t > end()) {
- _done = true;
- } else {
+ if (*t < end()) {
/* Given two choices at the same time, pick the one with texts so we see it before
the video.
*/
return {};
}
+
vector<dcpomatic::FontData>
Piece::fonts () const
{
}
}
}
+
+
+bool
+Piece::done () const
+{
+ auto film = _film.lock();
+ DCPOMATIC_ASSERT (film);
+ return content_time_to_dcp(_content, std::max(_decoder->position(), _content->trim_start())) > _content->end(film);
+}
+
void atmos (std::shared_ptr<const dcp::AtmosFrame> data, Frame frame, AtmosMetadata metadata);
void flush ();
+ bool done () const;
std::weak_ptr<const Film> _film;
std::shared_ptr<Content> _content;
std::shared_ptr<Decoder> _decoder;
FrameRateChange _frc;
bool _fast = false;
- bool _done = false;
boost::optional<dcpomatic::DCPTimePeriod> _ignore_video;
std::map<AudioStreamPtr, dcpomatic::DCPTime> _stream_last_push_end;